Far-right extremist Tristan Morgan, who set fire to a synagogue on a day commemorating the Holocaust, has been locked up in hospital indefinitely.
He laughed after he set fire to the synagogue in Exeter, Devon, the Old Bailey heard.
Morgan, from the city, was set on fire by the blast after he poured petrol into a window of the 18th Century building on 21 July 2018.
He had previously admitted arson and two terrorism-related charges.
These were for encouraging terrorism by publishing a song entitled White Man to live-streaming website Soundcloud and possessing a copy of the White Resistance Manual.
Prosecutor Alistair Richardson described Morgan as having a "deep-rooted anti-Semitic belief, embodied in a desire to do harm to the Jewish community and an obsession with abhorrent anti-Semitic material".
He said Morgan made songs "exhorting others to violence" against the Jewish community and had material that "revelled in the degenerate views of Nazi Germany and white supremacists".
He said when Morgan set the fire there was "no thought for any lives he might put at risk".
Morgan's van was identified on CCTV, and there was footage of him using a small axe to break a window at the synagogue and pouring liquid inside.
When police arrested him at his Alexander Terrace home he had burns to his hands, forehead and hair and was carrying two lock knives and two lighters.
As he was put in a police van, Morgan said: "Please tell me that synagogue is burning to the ground. If not, it's poor preparation."
The court heard the attack on the building coincided with a Jewish fast day commemorating disasters, including the Holocaust.
The repairs totalled more than £23,000.
Judge Anthony Leonard QC handed Morgan a hospital order without limit of time, saying most people would feel "anger and revulsion" for what he did.
President of the synagogue, Mr Richard Halsey, thanked the police for their "brilliant response" and "support".
He said the "whole Jewish community sincerely appreciates the support we have had from all faiths here in Exeter".