A teenager accused of making a pipe bomb in preparation for a terrorist act celebrated the killing of MP Jo Cox on the day she died, praising her murderer as a hero, a court has heard.
Prosecutors have told a jury how the 17-year-old, from Bradford, has demonstrated a range of racist and extreme views, partly through his association with the neo-Nazi youth group National Action.
Barnaby Jameson, prosecuting, said that on the day Mrs Cox was killed by Thomas Mair in her West Yorkshire constituency on June 16 last year, the defendant posted a picture of Mair on Facebook.
He also posted the message: "Tommy Mair is a HERO. There's one less race traitor in Britain thanks to this man."
Shortly after, on another social media site, the defendant posted the same picture with the post: "Absolute f****** legend. He's a hero, we need more people like him to butcher the race traitors."
Mr Jameson said that a week later, the defendant posted a link to an article on the Daily Stormer website, titled: "Brexit: Jo Cox' Death was Not a Tragedy and the World is a Better Place Without Her".
The prosecutor said: "(The teenager's) political views were so extreme that he celebrated in the murder of a democratically elected MP - presumably because she had voted to remain in the EU. In (the defendant's) view this was race treachery."
The judge, Mr Justice Goss, reminded the court that Mrs Cox's murder happened before the EU Referendum.
Mr Jameson took the jury through a number of social media postings and messages associated with the defendant, including footage the prosecutor said showed him at a National Action demonstration in York.
The prosecutor described National Action as "a small, secretive Neo-Nazi British youth nationalist organisation."
He said: "Little is known about its internal structure or the size of its membership. It is known to be a white supremacist group - anti-Muslim, anti-black, anti-semantic and anti-gay.
"At public meetings, members make the Nazi salute and keep their faces covered."
Mr Jameson said messages from members of a National Action chat group found on the defendant's phone included phrases like "should we just blow up Leeds or some shit?".
He told the jury: "As we will hear in due course, (the defendant) did something with a pipe bomb that was less to do with 'f***** around with them' and more to do with an ideological war he was waging."
On another messaging service, the defendant said: "Focusing on making homemade weapons (guns) and explosives, as well as amassing a collection of knives.
"We don't have any right to bears arms, so the resistance has to learn to construct its own weapons."
The blond-haired teenager, who cannot be named, denies a charge of preparing a terrorist act and an alternative count of making a pipe bomb.
He sat in the dock at Leeds Crown Court wearing a suit and flanked by a security guard.