A teenager has told a jury that a device found in his bedroom was a fake bomb he had made to show off to his friends.
The 16-year-old, who cannot be named, is on trial at Leeds Crown Court accused of accessing bomb-making instructions on the internet and making a potential bomb filled with shrapnel.
When he took to the witness box on Wednesday, the teenager told the jury he deliberately made a "prop" bomb at his grandfather's home in Bradford with some canisters from a paintballing gun he was intending to sell for scrap.
The teenager said: "It would look like a CO2 bomb but it was, like, an imitation."
Asked by his barrister, Ali Naseem Bajwa QC, why he did this, the boy said: "Just to show off to my mates.
"Like, I have a proper bomb here, even though it wouldn't be real."
The defendant told the jury he did not make the device by following instructions from YouTube.
He said he made it "off the top of my head, what I thought it would look like".
The boy said that he came up with the design because it was "something like off a movie or a game".
The defendant said he abandoned making the device before it was finished when he got bored of it.
"If I showed my mates this in public I could be shot, or worse," he told the jury.
Prosecutors told the jury earlier this month that the defendant 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".
They 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.
The jury was told he spoke to fellow pupils about carrying out a school shooting and praised Adolf Hitler.
Giving evidence, the teenager admitted that he made the comments about the school shooting.
Asked why, he said: "Just showing off. I didn't have a reason to show off this time. I was just being stupid."
The court has heard how the defendant first came to the attention of police aged 13 and was referred to Prevent, the Government's counter terrorism strategy, a year later, in 2017.
On Wednesday, the teenager, who gave evidence wearing a black suit, white shirt and black tie, told the jury that he lied to a worker at Prevent about a number of things because he wanted to keep on the programme to show off.
He said: "I said a bunch of things to keep Prevent on me.
"I felt kind of glad that she swallowed it up, all my lies."
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 was adjourned until Thursday.