Judge Brian Cogan wrote that there was a “serious need to protect the jury” given, in part, Ibrahim Suleiman Adnan Adam Harun’s “profound lack of respect for the judicial proceedings” — including threatening to kill prosecutors and court employees, as well as shouting obscenities during hearings.

Harun, who went by the nom de guerre “Spin Ghul” which means “White Rose” as a terrorist from 2001 to 2011, is also charged with plotting to bomb US government facilities in Nigeria.

He was arrested in Italy in 2011 and extradited to the US a year later.

Cogan granted the prosecutors’ motion for an anonymous jury but denied their request to have the panel be sequestered during breaks and escorted to the courthouse each day by US marshals.

The judge also wrote that potential jurors’ fear of retaliation from Harun — who is in solitary confinement — or other al Qaeda associates may impede their ability to serve.

Harun’s trial is currently scheduled to begin next February.

The jihadist’s bad behavior has raised questions over his mental health — he’s refused to come to court or cooperate with his own attorneys.

An anonymous jury was recently used in the Brooklyn terror trial for Tairod Pugh, the US Air Force vet convicted in March of trying to join ISIS.