A 16-year-old boy who made a potential bomb filled with shrapnel has been detained for five years.
Kieran Cleary, of Camberley Mount, Bradford, told friends he was going to "go on a rampage" and "kill many people", Leeds Crown Court was told.
After searching his home police found two carbon dioxide canisters as well as nails, tacks and panel pins.
Following a trial earlier this year, Cleary was convicted of making an explosive substance.
He was also found guilty of possessing a document likely to be useful to a person committing or preparing an act of terrorism. He was cleared of the more serious offence of making an explosive substance with intent.
Leeds Crown Court heard the boy had also told fellow students in 2017 he was going to carry out a school shooting and had praised Adolf Hitler.
'Dark and homicidal'
Prosecutors said he had researched bomb-making tactics online and nearly created a weapon with a potential 30-metre blast radius capable of being used "to cause maximum harm and death to civilians".
His internet searches reflected a desire to seek out "extreme right-wing material and anti-Muslim material", the court was told.
Sentencing him on Friday to five years in custody, Judge Geoffrey Marson QC said: "The evidence shows that you are prone to violence and harbour dark and homicidal thoughts.
"By its verdict, the jury were satisfied that you intended to complete the bomb and create a viable explosive device.
"There was a great potential for harm, even if there was no intention to use it."
Cleary first came to the attention of police aged 13 and was referred to Prevent, the government's counter-terrorism strategy, in 2017, the court heard.
In July 2018, Prevent received information that he had told fellow pupils he was going to go on a rampage, aiming to kill many people and then be shot by the police or kill himself, and this led to the search of his home.
Det Ch Supt Martin Snowden, from Counter Terrorism Policing North East, said: "This is a disturbing case of a teenager who developed an alarming interest in extremist ideology, violence, firearms and explosives.
"Despite extensive attempts to steer this boy away from the path of criminality, due to the progression of his behaviour, he was arrested and charged with serious offences."