A public schoolboy who caused £40 million of damage to the economy by throwing firebombs on to a motorway has been detained in a psychiatric hospital.
Judge Keith Cutler described 17-year-old Nicholas Elger, from Winchester, Hampshire, as a "dangerous young man" for throwing the petrol bombs onto the M3 motorway on two occasions in September 2017.
He ordered that the defendant be treated and assessed at a psychiatric unit but warned him he faced a considerable custodial sentence if his condition was deemed to be untreatable.
A further hearing at Winchester Crown Court will be held on May 18.
The judge told him: "It's clear to me that you are a dangerous young man who has committed serious offences.
"I am very concerned about your thoughts, what is actually going on within your plans, in your mind."
He added: "I am not willing at this stage to shut the door on treatment."
The judge lifted the defendant's right to anonymity given to minors because of the public interest in the serious offences.
Rob Welling, prosecuting, said that Elger confessed to carrying out the attacks and said that he had been hearing voices and "was sort of trying to kill someone".
He said that on both occasions he had thrown the Molotov cocktails, made with items stolen from a Tesco store, from a bridge close to junction 10 of the motorway.
He said that one witness described the "carriageway ablaze with flames reaching the height of a person" and another had to swerve on to the hard shoulder to avoid the "firebomb".
Mr Welling said that the second attack, on September 23, caused the closure of the motorway for several hours creating massive tailbacks.
He said: "The estimated damage to the local economy is £40 million, we know that many people were left stranded on the M3 for many, many hours as a result of that closure."
The teenager had pleaded guilty to two arson charges as well as burglary and blackmail charges against top public school Winchester College which he attended as a boarder and two charges of theft.
The court heard that he twice demanded payment of £10,000 in the online currency bitcoin from the school in order for him to stop carrying out further break-ins during which he had stolen £37,000 worth of computer equipment.
Mr Welling said that Elger's housemaster had been concerned by his behaviour which included adopting an alter ego with the name of James and having a knife engraved with this name.
He also collected hundreds of matches and had drawn an "eerie" picture on a notice board, the court heard.
Referring to the burglaries, Mr Welling said: "He described when interviewed that he did it for satisfaction and he found the risk enjoyable."
Robert Morris, defending, said Elger was a "deeply troubled individual" who had been described as a child as a "kind and pleasant boy" but had "lost the opportunity to go to a top university".