A public schoolboy who caused £40m of damage to the economy by throwing homemade firebombs on to a motorway has been detained in a psychiatric hospital.
Nicholas Elger from Winchester, Hampshire, was described by the judge as a "dangerous young man".
The 17-year-old threw petrol bombs on to the M3 motorwayon two occasions in September 2017. Thousands of motorists and passengers were stranded for hours.
Prosecutors said Elger confessed to carrying out the attacks. They say he had been hearing voices and "was sort of trying to kill someone".
Judge Keith Cutler ordered that the defendant be treated and assessed at a psychiatric unit. If doctors are unable to treat him, Elger will face a considerable custodial sentence.
"It's clear to me that you are a dangerous young man who has committed serious offences," Judge Cutler told the court.
The judge lifted reporting restrictions on naming Elger because of the public interest in the serious offences.
Elger constructed Molotov cocktails using items stolen from a Tesco store.
He threw them from a bridge close to junction 10 of the M3, which is the main route between London and Southampton.
Prosecutors told the court that a 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".
The second attack, on 23 September, closed the motorway for several hours and sparked massive tailbacks.
Rob Welling, prosecuting, said: "The estimated damage to the local economy is £40m, 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 Winchester College, a top public school which he attended as a boarder.
He also pleaded guilty to two charges of theft.
Elger had 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 computer equipment worth £37,000.
Referring to the burglaries, Mr Welling said "he did it for satisfaction and he found the risk enjoyable."
When interviewed, prosecutors say Elger said he enjoyed the risk.
The student adopted an alter ego, James, and engraved the name into a knife, Mr Welling said.
He also collected hundreds of matches and had drawn an "eerie" picture on a notice board.
Elger has since been expelled.
Robert Morris, defending, said Elger was a "deeply troubled individual".
Mr Morris went on to say Elger had been described as a child as a "kind and pleasant boy" but had "lost the opportunity to go to a top university".
A further hearing at Winchester Crown Court will be held on May 18.