A plot to make bombs by two teenage friends who discussed blowing up Buckingham Palace was foiled when they were discovered by one of their mothers.
The 16-year-olds from the north-east of the UK, who cannot be identified for legal reasons, have been locked up for a year after they admitted buying chemicals online which were delivered to one of their homes.
Specialists subsequently confirmed that the material discovered could have been used to manufacture viable explosive devices, similar to hand grenades, the Crown Prosecution Service said.
They were sentenced on Friday at Newcastle Crown Court having previously admitted conspiracy to make an explosive substance for unlawful purposes, and both were sentenced to a 12-month detention and training order.
One of the boy's mothers contacted police after she discovered the substances that had been delivered to her home.
After the case, the CPS released photos of fuses, pipes and some of the chemicals they ordered.
John Dilworth, Deputy Chief Crown Prosecutor for CPS North East, said afterwards: "It is alarming to note that, at the point when their scheme was discovered, these two young men had already secured all of the materials required to construct a viable explosive device.
"Thankfully, the potentially tragic consequences of their plans were never realised. We are grateful to the actions of the defendants' relatives, whose suspicions alerted police to the serious risk posed, not only to the public at large but also to the young defendants themselves."
One boy was described as a loner by his parents, and schoolmates knew he used drugs, while the other boy was said to be prone to erratic behaviour and suicidal thoughts.
The court heard how the loner showed other pupils photographs of drugs, money and weapons, would tell sick jokes about 9/11 and latterly claimed he was making a bomb.
The two defendants talked on Skype and last October discussed selling drugs to buy the materials needed to make a pipe bomb and a firearm.
Newcastle Crown Court heard how they discussed potential targets, including a local public school, the Houses of Parliament, Buckingham Palace and "a random shopping centre".
Escape plans were discussed along with potential suicide, both teens stating that it was what they had wanted for a long time. Fuses and sections of pipe arrived at one defendant's home and he told his parents they were for a school project.
When the items were confiscated, he said he was going to blow himself up on the school field.
Packages containing various chemicals also arrived at the other boy's home.
His father looked on the internet and discovered they could be used to make an explosive substance. At first the teenager claimed it was for a science experiment before admitting he was making the explosive substance with his friend.
Soon after, his mother phoned the police when, concerned he was taking drugs, she found bags of powder in his bedroom.
Those powders were seized and subsequently found to be paracetamol, caffeine and sucrose, substances commonly used to cut illegal drugs.
There were other substances also seized which, when mixed, could be made into explosives. Fuses and pipes were recovered from the other boy's house. Examination of phones later showed racist messages, chat and links about making nail bombs and Molotov cocktails, among other items.
A telephone seized from the other youth was found to contain images of knives, a replica gun, bullets, money, a bag of white powder and alcohol.
The prosecution said an Army expert found that if the chemicals and the pipes were correctly assembled, they would have similar characteristics to a grenade.
One boy told police they were assembling devices based upon a recipe from the Anarchist's Cook Book which he intended to use to blow himself up.
He said he was suicidal and wanted to kill himself in the middle of a field, but his friend intended to "go out with a bang" in the middle of Newcastle, taking others with him, the court was told.