British MP Jo Cox has died after being shot in her constituency in northern England, in an attack which has left the UK in shock and caused campaigning for next week's European Union referendum to be suspended.

Key points: Police arrest 52-year-old man

Police arrest 52-year-old man British leaders pay tribute to 41-year-old Jo Cox

British leaders pay tribute to 41-year-old Jo Cox Witnesses say the attacker had a gun and knife

Mrs Cox, a vocal supporter of immigration and Britain remaining in the European Union, was shot in the street outside a library where she was meeting with constituents in Birstall, near Leeds.

The attacker was named by British media as local man Tommy Mair, with neighbours quoted as saying he was a "loner" with a history of mental health problems.

Media reported his home was a short walk from Mrs Cox's office, and that forensic officers were searching the house and a row of garages behind it.

Police said a 52-year-old man was in custody and said they were not looking for anyone else.

West Yorkshire chief constable Dee Collins said police were investigating a motive for the attack.

Sorry, this video has expired Footage shows police arresting man after Jo Cox's murder

"This is a very significant investigation with large numbers of witnesses who have been spoken to by police at this time," she said.

"We are not in a position to discuss any motive at this time."

Loading

Mrs Cox, 41, the mother of two daughters, died in hospital after the attack. Shortly before her death was announced her husband, Brendan, tweeted a simple tribute — a photo of her standing by the River Thames in London.

"Jo believed in a better world and she fought for it every day of her life with an energy, and a zest for life that would exhaust most people," he said in a statement.

"She would have wanted two things above all else to happen now: one, that our precious children are bathed in love; and two, that we all unite to fight against the hatred that killed her.

"Hate doesn't have a creed, race or religion, it is poisonous."

Issues around immigration have played a major role in the debate over whether the UK should stay in the EU, but it is not known if the attack had anything to do with Mrs Cox's political positions.

The BBC reported that a witness said the assailant screamed out "Put Britain first" before shooting the MP.

Cameron, Corbyn pay tribute to 'great star' with 'big heart'

British Prime Minister David Cameron said the death was a tragedy, and that Mrs Cox was a committed and caring member of Parliament.

"We have lost a great star," the Conservative Prime Minister said in a statement.

Jo Cox was attacked as she prepared to hold a meeting with constituents. ( Twitter: Jo Cox )

"She was a great campaigning MP with huge compassion, with a big heart. It is dreadful, dreadful news."

British Labour leader Jeremy Corbyn took to Twitter to pay tribute to the "universally liked" Mrs Cox, who was elected as Batley and Spen MP in 2015.

"Jo died doing her public duty at the heart of our democracy, listening to and representing the people she was elected to serve," he said.

"It is a profoundly important cause for us all."

Prime Minister Malcolm Turnbull tweeted: "Deeply shocked by the murder of UK MP Jo Cox. Our condolences, prayers and solidarity are with her family & the people of the UK".

Dozens of Mrs Cox's friends and colleagues gathered for a church vigil in Birstall, as flowers and tributes were left in the small village and at a makeshift memorial in Parliament Square, central London.

Mrs Cox was a Cambridge University graduate and aid worker before becoming the Labour MP for the constituency of Batley and Spen in 2015.

She worked with several charities throughout her career and developed a reputation for her work on immigration women's issues.

Attacker wielded gun and knife

Cafe owner Clarke Rothwell witnessed the incident and said the suspect had both a gun and a large hunting knife.

"An old-fashioned looking gun in his hands," he said.

"And he shot this lady once and then he shot her again and she fell to the floor.

"Somebody tried wrestling with him and then he wielded a knife."

Sorry, this video has expired Yorkshire police confirm Jo Cox died after attack

Another witness told Sky News that Mrs Cox had intervened in a scuffle between two men, one of whom had pulled a gun from a bag which had then been fired twice.

"I saw people rushing down the road towards the library. I came out with a couple of people from the restaurant ... we saw a man wearing a dirty white baseball cap with grey jacket start jostling with somebody," Hichem Ben-Abdallah said.

"All of a sudden this guy pulls a gun ... it looked like a First World War gun or makeshift gun, not the sort of gun you see normally.

"He fired the first shot then I ran away and then we heard the second shot."

Police and forensics attend the scene where Jo Cox was attacked.

Police said a 77-year-old man was also assaulted in the incident and suffered injuries that were not life-threatening.

British politicians are not in Parliament at the moment ahead of next week's referendum on whether Britain should remain in the EU.

Both referendum campaigns have suspended all campaigning for the day in the wake of the attack that has left the small village in shock.

Mr Cameron cancelled a planned rally during a historic but controversial visit to Gibraltar — a rocky outcrop also claimed by Spain — as part of his campaign for Britain to remain in the EU.

The looming prospect of a Brexit has sparked volatility in the financial markets and sent the pound plunging, and prompted interventions from a number of EU leaders.

ABC/wires