LONDON (Reuters) - A loner obsessed with Nazis and extreme right-wing ideology was sentenced on Wednesday to spend the rest of his life in prison for murdering lawmaker Jo Cox in a frenzied street attack that stunned Britain a week before the European Union referendum.

A woman holds a placard and white roses during a special service for murdered Labour Party MP Jo Cox, at Trafalgar Square in London, Britain June 22, 2016. REUTERS/Peter Nicholls

Armed with a sawn-off rifle and a dagger, Thomas Mair, 53, shot Cox three times and repeatedly stabbed the 41-year-old mother of two young children in her northern English electoral district as she arrived for a meeting with local residents.

During the June 16 attack, he shouted “Britain first” and “Keep Britain independent”, his trial heard. When arrested he told officers he was a political activist and his only words in court were when he gave his name as “death to traitors, freedom for Britain”.

Cox’s murder horrified Britain, elicited condolences from leaders around the world and led to the suspension for several days of campaigning ahead of an EU vote that had become increasingly ugly and replete with personal recriminations.

Mair, slight of build and balding with a gray goatee beard, refused to speak to police, enter a plea or offer any defense at the London Old Bailey trial, which was treated as a terrorism case.

He asked to make a statement only after the jury unanimously returned a guilty verdict, but Judge Alan Wilkie refused.

“You are no patriot,” Wilkie told him. “It is clear ... that your inspiration is not love of country or your fellow citizens, it is an admiration for Nazism and similar anti-democratic, white supremacist creeds.”

During the eight-day trial, Mair remained silent and gave no explanation as to why he attacked Cox, a former humanitarian aid worker who campaigned for Britain to stay in the EU.

Mair, who had never come to police attention before, was also convicted of grievous bodily harm for stabbing a 77-year-old man who tried to save Cox during the assault outside Birstall library in the region of West Yorkshire.

She had only been in parliament for little more than a year, after easily winning the seat for the opposition Labour party in the area where she grew up.

Slideshow ( 6 images )

SHY LONER

Mair had lived in a unremarkable house in Birstall for 20 years, spent much of his time in his garden would occasionally mow neighbors’ lawns. They said he never had visitors, spoke little and avoided eye contact.

“He was a loner in the truest sense of the word. No mental health diagnosis of any illness but signs of obsessive compulsive (disorder),” Detective Superintendent Nick Wallen told reporters.

“He can’t react with other people in a social setting. To think that he’s part of a wider group I think would be wholly wrong.”

Police pictures following a search showed a sparsely furnished, neat house with almost bare cupboards in the kitchen and single beds in the bedrooms.

But there were clear signs of his far-right leanings.

On top of a bookcase in one of the bedrooms, detectives found a Third Reich eagle ornament with a swastika on it, while on neatly organized shelves were dozens of books about German military history, Nazi race theory and white supremacism.

The Southern Poverty Law Center (SPLC), a civil rights group based in the U.S. state of Alabama, said on its website that it had obtained records showing Mair had links with the neo-Nazi organization National Alliance dating back to 1999.

He also had letters printed in a South African pro-apartheid magazine, the SPLC said.

An analysis of his Internet usage on computers in local libraries also showed Mair’s obsession with the far right.

In the days and months before the attack, he read articles about Nazi figures, the Ku Klux Klan and Dylann Roof, the man accused of killing nine black parishioners at a church in Charleston, South Carolina.

He had also looked up the Wikipedia entry for Ian Gow, the last British lawmaker to have been killed before Cox, in 1990.

Wallen said they were still investigating how a loner like Mair had got hold of the gun, which had been stolen a year earlier, and there was no evidence he was linked to any group or other individuals.

He said he believed Mair had obtained it just weeks before the attack and then began plotting the murder, starting his research into Cox just nine days before the killing.

The detective said Brexit was a motivating factor but Cox also stood for a world view which Mair hated.

When arrested, Mair was still carrying 25 bullets and police said it was possible he was even planning to kill his mother. Mair’s half-brother is mixed race and Mair had accessed websites about matricide two days before the attack.

“Was he planning some kind of spectacular somewhere else? Was he intending to commit suicide? Was he intending to kill his mother? All of that is speculation,” Wallen said.

Cox’s husband, Brendan, said that instead of silencing her, the murder had allowed millions to hear her voice.

“To the person who did this, we have nothing but pity that his life was devoid of love and consumed with hatred, that this became his desperate and cowardly attempt to find meaning,” he said outside court.