WASHINGTON (AP) — A federal appeals court has thrown out years of legal proceedings in the already-delayed military commission case against a Saudi charged in the deadly 2000 bombing of a U.S. warship.

An appellate panel in Washington said Tuesday that a military judge improperly continued to preside over the case after he sought a job in the Justice Department beginning in 2015. Retired Air Force Col. Vance Spath took a job last year as an immigration judge in the Justice Department.

“We cannot permit an appearance of partiality to infect a system of justice that requires the most scrupulous conduct from its adjudicators,” Judge David Tatel wrote for the unanimous three-judge panel. The military judge who briefly replaced Spath, Col. Shelly Schools, was taken off the case after it was revealed that Schools also was seeking to becoming an immigration judge.

Defendant Abd al-Rahim al-Nashiri is accused of orchestrating the October 2000 bombing of the USS Cole, which killed 17 sailors and wounded 37. He could get the death penalty if convicted by the commission of charges that include terrorism and murder for his alleged role in the al-Qaida plot.

Al-Nashiri, in U.S. custody since 2002, is being held at the U.S. Navy base at Guantanamo Bay, Cuba.

University of Texas law professor Stephen Vladeck said the ruling probably means additional years of delay “because a lot of these issues are going to have to be re-litigated from scratch.”

The military commission proceedings have repeatedly stalled since al-Nashiri’s arraignment in 2011. Spath himself called a halt last year following the discovery of microphones in a room where al-Nashiri met with his lawyers, and the lawyers’ subsequent decision to resign from the case for ethical reasons.

Spath touted his role as the presiding judge over al-Nashiri’s case in his employment application, including submitting an order he had issued as a writing sample, the appeals court said.

But “while Spath made sure to tell the Justice Department about his assignment to Al-Nashiri’s commission, he was not so forthcoming with Al-Nashiri. At no point in the two-plus years after submitting his application did Spath disclose his efforts to secure employment” as an immigration judge, Tatel wrote.

The court also was critical of prosecutors, the Justice Department and the Court of Military Commission Review, which had upheld many of Spath’s orders.

“To me, it’s a stunning rebuke of not only Judge Spath, but also the government lawyers and the Court of Military Commission Review for not showing far greater concern for the appearance of impartiality in a capital case, no matter — if not especially because of — what folks might think of the defendant,” Vladeck wrote in an email.