A teenager told fellow pupils he was going to "go on a rampage" and "kill many people" just weeks after making a potential bomb filled with shrapnel, a court has heard.

The 16-year-old boy had also told students a year previously that he was going to carry out a school shooting and had praised Adolf Hitler, Leeds Crown Court heard.

The jury was told that he had researched bomb-making "extensively" and constructed a device that, with the addition of gunpowder and a fuse, could have been a "viable CO2 bomb", of the type used "to cause maximum harm and death to civilians".

Paul Greaney QC, opening the case for the prosecution, said: "Like many young teenagers, (the boy) had strong opinions and an intense interest in the internet.

"However, as he became older, both his opinions and his use of the internet became increasingly disturbing, indeed menacing."

The barrister told the court the boy developed an interest in extremist far right ideology and his searches on the internet became "progressively dark", accessing videos and information about murder, torture and mutilation.

He told the court the research he had conducted showed that his purpose in making the device in June 2018 was "malevolent" and indicated that "his intention was to endanger life or to cause serious damage to property".

Mr Greaney said: "He actually constructed a device that, with the simple addition of gunpowder, such as might have been obtained from fireworks, and a basic fuse would have been a viable CO2 bomb.

"Furthermore, he had loaded that device with shrapnel, such as is commonly used by bomb-makers to cause maximum harm and death to civilians."

The boy, who cannot be named for legal reasons, first came to the attention of police aged 13 and was referred to Prevent, the Government's counter terrorism strategy, just a year later in 2017, the court heard.

Mr Greaney said: "He spoke to fellow pupils of carrying out a school shooting and praised Adolf Hitler, stating 'gas the Jews'."

In July 2018, Prevent received information that the boy 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, the court heard.

Mr Greaney said this led to a search of his home in Bradford by the Counter Terrorism Unit who found items, including two carbon dioxide canisters joined together and an assortment of nails, tacks and panel pins.

He said: "An expert has examined the canisters and has expressed the view that they have been drilled out in accordance with instructions for the manufacture of a CO2 bomb. That, ultimately, is what (the boy) was constructing, a bomb."

The jury of eight men and four women also heard that a copy of the Anarchist's Corner, a document containing bomb-making instructions, was found on a CD, which contained the sentence: "It can also be used for crowd control or killing if shrapnel is added."

Mr Greaney said: "This makes clear, in very stark terms, what is in any event obvious, namely that a CO2 bomb containing shrapnel is capable of causing not only serious harm, but death."

The boy denies one count of making an explosive substance with intent, one count of making an explosive substance and three counts of possession of a document likely to be useful to a person committing or preparing an act of terrorism.

The case continues.