Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Police in England have charged a man being held in the deadly stabbing and shooting of a British lawmaker, in an attack that came amid a heated debate in the country over whether to remain in the European Union.

Thomas Mair, 52, of Birstall, was charged with murder and weapons charges in the deadly attack on Jo Cox, West Yorkshire Police said early Saturday local time.

Cox was shot and stabbed in broad daylight shortly before 1 p.m. in Birstall, not far from the city of Leeds.

A motive in the attack is under investigation, and it is unclear whether it may have been connected to the upcoming referendum over whether Britain should remain in the E.U. But the murder of a lawmaker who supports Britain remaining in the E.U. a week before the poll has raised questions as to whether the referendum may have played a role in the attack.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

A witness told the BBC that they heard the attacker yell "Britain first," which is a rallying cry for anti-immigrant groups who want the country to leave the E.U.

Farren Vanderhyden lays down a Union flag in Market Square on June 17, 2016 in Birstall in memory of Jo Cox, 41, Labour MP for Batley and Spen, who was shot and stabbed Thursday by an attacker. Christopher Furlong / Getty Images

Police said Friday they are investigating whether the attacker may be linked to right wing extremism, but have not drawn any conclusions as to a motive.

The U.S.-based Southern Poverty Law Center said it has "documentary proof" linking Mair to the American neo-Nazi organization the National Alliance between 1999 and 2003.

The SPLC, which tracks hate groups, also said that Mair had purchased titles including the "Improvised Munitions Handbook," which gave instructions on how to build a pistol — from the National Alliance's publishing imprint.

Cox, seen as rising star of the Labour Party, has argued that Britain should remain in the European Union. Her death has shaken the country, where gun control is strict and gun violence is rare.

While a motive in the attack has not been established by authorities, campaigning on the referendum to leave the E.U., referred to by some as the “Brexit,” was suspended. The poll will be held next Thursday.

Mair is charged with murder, grievous bodily harm, possession of a firearm with intent to commit an indictable offence and possession of an offensive weapon, police said. Mair is due in court in London Saturday.

A man identified as Mair's half-brother expressed shock at his arrest. He told ITV that Mair's mother "can't understand" what may have happened.

Also Friday, President Barack Obama called Cox’s husband, Brendan Cox, to offer "his sincere condolences on behalf of the American people to Mr. Cox and his two young children, as well as to her friends, colleagues, and constituents," the White House said in a statement.

"The President noted that the world is a better place because of her selfless service to others, and that there can be no justification for this heinous crime, which robbed a family, a community, and a nation of a dedicated wife, mother, and public servant," the White House said.

West Yorkshire Police said the murder appears to be an isolated attack on the lawmaker, and investigators have no information that anyone else was involved in the killing. Authorities will be investigating how Mair got the firearm, police said.