West Yorkshire police said that Jo Cox, a 41-year-old member of Parliament, was pronounced dead an hour after she was attacked in Leeds. (TWP)

West Yorkshire police said that Jo Cox, a 41-year-old member of Parliament, was pronounced dead an hour after she was attacked in Leeds. (TWP)

A rising star in Britain’s Parliament was shot and stabbed to death Thursday in an attack that stunned the nation and brought the country’s European Union referendum campaign to an abrupt halt just a week before the vote.

The killing was of the sort that has become all too common in the United States, but is virtually unheard of in Britain: without warning, hyper-violent and ultimately, perhaps, inexplicable.

It claimed as its victim Jo Cox, a widely respected 41-year-old member of the center-left Labour Party who won election last year after a career in humanitarian work and who was widely respected for her outspoken advocacy on behalf of refugees and civilians in Syria.

Police officials in the northern English region of West Yorkshire said Cox was pronounced dead just before 2 p.m. local time, an hour after she was assaulted outside a library near the city of Leeds. A 52-year-old man was taken into custody, and police said he was the only suspect.

[What the fatal attack on a British politician says about guns in the U.K.]

1 of 29 Full Screen Autoplay Close Skip Ad × What the scene of the deadly shooting of a British politician looks like View Photos Jo Cox, a member of Britain’s Parliament, was shot and stabbed Thursday near the northern city of Leeds. Caption Cox, a member of Britain’s Parliament, was shot and stabbed near the northern city of Leeds. June 17, 2016 Candles surround a photo of British lawmaker Jo Cox before a vigil in her memory at George Square in Glasgow, Scotland. In the foreground, Scottish Labour Party leader Kezia Dugdale holds a rose. Jeff J. Mitchell/Getty Images Buy Photo Wait 1 second to continue.

Officials did not provide a motive for the killing. But British media organizations including the Guardian and Sky News quoted witnesses as saying that the assailant shouted “Britain first!” during and after the attack.

Britain First is the name of a far-right group that stages provocative anti-Muslim demonstrations. After Thursday's attack, the organization posted a statement on its website denying involvement and saying it “would never encourage behavior of this sort.”

Witnesses told British media that the assailant appeared to have been waiting for Cox outside a library in the town of Birstall where she had been meeting constituents as part of her usual weekly schedule.

[Jo Cox, slain British politician, was a champion of refugees]

The man was not named by police but was identified in the British media as Tommy Mair, a local resident whom neighbors described as quiet and devoted to his mother. Family members said they were astonished by the arrest, and that Mair had never expressed strong political views, but that he had an obsessive personality.

The BBC broadcast a photo that it said showed the moment the suspected assailant was arrested. He appeared to be a white male dressed in a gray T-shirt and black pants.

Witnesses recounted a savage attack in which the assailant targeted Cox with a gun that was either homemade or antique, as well as with a knife. The attacker continued to stab and kick Cox even after she had fallen to the ground, bleeding.

Floral tributes and candles are placed by a picture of slain Labour MP Jo Cox at a vigil in Parliament square in London. (Daniel Leal-Olivas/AFP/Getty Images)

The killing shook Britain to the core and prompted an outpouring of grief across the political spectrum. It came as the country heads into the homestretch of a bitter campaign to determine whether to stay in the E.U., with a vote scheduled next Thursday.

[Reports of a cry of ‘Britain first’ in shooting of U.K. politician stir controversy]

Both the pro- and anti-E.U. camps announced that they were suspending their campaigns at least until the weekend. Cox was a supporter of keeping Britain in the 28-nation bloc, but she was lauded Thursday by those on both sides of the debate.

“We’ve lost a great star,” Prime Minister David Cameron told the BBC. “She had a huge heart. She was a very compassionate, campaigning MP. She was a bright star, no doubt about it — a star for her constituents, a star for Parliament, and a star right across the House, and we have lost a star.”

[Tributes flood social media after shocking death of Jo Cox]

Cameron’s predecessor, former prime minister Gordon Brown, described the attack as “a devastating blow to our democracy.” Cox had worked as an adviser to Brown’s wife, Sarah Brown, on women’s and children’s health campaigns.

“Sarah and I were privileged to work with Jo and her husband Brendan over many years and in her tireless efforts on behalf of poor and desolate children and mothers,” Brown wrote. “She went to some of the most dangerous places in the world. The last place she should have been in danger was in her home town.”

[British government could also hang in balance of E.U. referendum]

Gun attacks in Britain are rare, a fact that authorities here attribute to extremely tight gun-control restrictions. Attacks against members of Parliament are also highly unusual, and beyond those at the highest reaches of government, politicians customarily do not have security details.

The last British lawmaker to be killed while in office was Conservative Ian Gow in 1990 from a bomb placed under his car by the Irish Republican Army. The same year, a former Parliament member, Donald Kaberry, was wounded in an IRA bombing and died the next year.

The attack on Cox echoed the 2011 shooting of then-Rep. Gabrielle Giffords (D-Ariz.) in Tucson, also while meeting constituents. Giffords was severely wounded but survived. On Thursday, she tweeted: “Absolutely sickened to hear of the assassination of Jo Cox. She was young, courageous, and hardworking. A rising star, mother, and wife.”

[A British vote to leave the E.U. could shatter the United Kingdom]

Cox was leaving the library when, according to witnesses, the attack began suddenly.

Hithem Ben Abdallah, a resident who told reporters he had seen the assault firsthand, described how a good Samaritan initially tried to stop the attacker from stabbing Cox. But the attacker, who was wearing a white baseball cap, then pulled a gun from a bag and scuffled with Cox before shooting her at least twice.

“He was fighting with her and wrestling with her and then the gun went off twice and then she fell between two cars and I came and saw her bleeding on the floor,” Abdallah said, according to Britain’s Press Association.

Aamir Tahir, 33, who runs a dry-cleaning center about 100 yards from the scene of the attack, said in an interview that a female employee “heard two loud pops. She was in the back, doing the ironing, and heard two loud pops and some shouting. But she kept to her own until she heard the sirens, and when she went outside, there were police everywhere.”

Asked about reports that the assailant said “Britain first,” he said that neither he nor his employee had heard that.

Tahir said the quiet street where the killing unfolded is normally “really nice. It’s like a little village.”

Cox, the mother of two young children, was elected in May 2015. She also was national chair of Labour Women’s Network and a senior adviser to the Freedom Fund, a group that campaigns against slavery and other domestic and workplace abuses.

On her Twitter page, she described herself as “mum, proud Yorkshire lass, boat dweller, mountain climber and former aid worker.” She previously worked as an adviser to the Britain-based aid group Oxfam.

In Parliament, Cox had been outspoken about the need to do more to protect civilians in Syria, and had argued in the House of Commons for Britain to accept 3,000 child refugees.

Before Cox’s death was announced Thursday afternoon, her husband posted a photo of her on Twitter standing beside their houseboat in London.

Brendan Cox later released a statement saying his wife would have had no regrets about her life.

“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 wrote. “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.”

Read more:

What would Britain look like post-Brexit? Here are four possibilities.

Anti-Muslim group picks a fight in British Muslim neighborhood, and gets one

As polls tighten, Cameron pleads with unhappy voters to back away from ‘Brexit’

When Britain votes on the E.U., Western security could be on the line

Brian Murphy contributed to this report from London.