An accused would-be bomber from Hillside known to ramble on about reptilian overlords, the Illuminati and Free Masons is not mentally fit for trial, a federal judge ruled Thursday.

And while the conclusion drawn in the case of 22-year-old Adel Daoud may seem obvious to people not familiar with the law, one legal expert called U.S. District Judge Sharon Johnson Coleman’s rare finding “extraordinary.” Daoud’s own attorney, Thomas Anthony Durkin, called it a “tremendous relief” to the young man’s family.

“This is a significant legal ruling,” Durkin said after court. “This is a very, very significant and courageous ruling in the face of the war on terror. This is not something that happens.”

Still, Coleman did not cancel Daoud’s Feb. 7 terrorism trial. Rather, she called it a “close case” and ordered Daoud into a secure psychiatric facility for three months of treatment. She told lawyers that “the prudent course is to find that Daoud is incompetent.”

The judge also acknowledged Daoud has a “factual understanding of the proceedings against him.”

“However, his rational understanding of the proceedings is significantly undermined by his pervasive belief that the court and the prosecution are members of the Illuminati and that his attorneys are Freemasons,” Coleman said. “Daoud states that he believes the justice system is controlled by the Illuminati, a secret ruling class, who he repeatedly describes as reptiles in disguise.”

That’s the ruling Daoud’s lawyers hoped for. But Daoud hoped things would go the other way. Often jovial in court, he looked sullen Thursday as he sat and listened to Coleman read her ruling. Daoud has spent most of his adult life behind bars — largely in solitary confinement — and Coleman blamed his mental issues, in part, on his lengthy incarceration.

Hugh Mundy, an associate professor at The John Marshall Law School, predicted Daoud will again be found competent “through medication and treatment” at the end of the three-month period ordered by the judge. Dr. Richart DeMier already reached that conclusion once this year after evaluating Daoud at a federal facility in Missouri.

But Durkin cast doubt Thursday on whether three months is enough time to restore the mental competency of a man who predicts the government will execute him by beheading and blames his cellmate’s suicide on Coleman. Durkin said Daoud, arrested as an 18-year-old for allegedly plotting a jihadist attack, could wind up in psychiatric facilities for the rest of his life.

“I think we need to come to grips as a country with this whole concept of the war on terror and what we do with our own citizens who become influenced by radical ideas,” Durkin said. “These are American citizens. This isn’t somebody coming, you know, from Iraq or Syria that Donald Trump likes to yell about, or anybody else. This is an American youth.”

It has been nearly four years since Daoud said a prayer and allegedly pushed the detonator on a fake car bomb given to him by an undercover federal agent in September 2012. The feds say Daoud parked the inert explosive near a downtown Chicago bar as he sought to attack “the most evil place.”

While in jail, Daoud allegedly tried to plot the murder of the undercover agent. And he allegedly assaulted a fellow inmate last year over a cartoon of the Prophet Muhammad. A two-day competency hearing last week revealed that he had assaulted the inmate once before — but he took the Charlie Hebdo attack as a sign he should take the violence further.

His case received national attention in 2014 when Coleman found that Daoud’s attorney should be allowed to see the classified surveillance evidence gathered against him during a months-long investigation. The 7th U.S. Circuit Court of Appeals eventually overruled her.

Contributing: Stefano Esposito