Teenager Michael Piggin, who kept a stash of weapons in his home but denied he was planning a repeat of the Columbine school massacre, has been detained under the Mental Health Act.
Piggin, 18, admitted possessing petrol bombs and component parts of pipe bombs for use as explosive devices.
He also pleaded guilty to possessing the component parts for improvised explosive devices (IEDs).
Police discovered a hoard of petrol bombs and air rifles when they were called to investigate a public order offence from six days earlier at his home in Beaumont Road, Loughborough, in February last year.
Piggin, who has Asperger's syndrome, denied he was going to attack his old school in a re-run of the Columbine massacre.
In sentencing at the Old Bailey, Recorder of London Brian Barker QC told Piggin that he should be held "under the Mental Health Act, which will provide you with appropriate treatment for as long as is deemed necessary".
The judge said: "Cases of this type are fortunately rare but of great concern to the public and normally would attract long sentences.
"Given your personal condition, this is not a case of a determinate sentence. It is clear from reports that you need treatment."
The judge said the potential danger to the public was "uppermost" in his mind.
After two trials, jurors could not agree and were discharged from returning verdicts on two charges under the Terrorism Act to which Piggin had pleaded not guilty.
Following the retrial, Piggin was told the Crown would not be seeking a further prosecution.
The Columbine High School massacre of 1999 was one of America's worst mass shootings. Eric Harris and Dylan Klebold murdered 12 students and a teacher at the school in Colorado before both committing suicide.
Officers who unearthed a cache of weapons when they searched Piggin's bedroom also found material to do with military matters and the Third Reich.
The judge told Piggin: "Numerous entries in your notebook and on Facebook plus internet searches all indicate a fascination with guns and the perpetrators of the Columbine massacre."
He also noted that talks with people who knew him had painted " a picture of friction, difficulties, intransigent views and outright racism".
Piggin had previously pleaded not guilty to two charges under the Terrorism Act.
He denied possessing items for the purpose, preparation and instigation of an act of terrorism and possessing a document or record containing information likely to be useful for a person committing or preparing an act of terrorism.
He has faced two trials, but both juries was discharged after failing to reach a verdict on the terror charges.
The judge today directed that not guilty verdicts be returned on the terror charges.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules hereComments are closed on this article