A federal appeals court in Washington on Tuesday rejected yearslong proceedings against the accused mastermind of the October 2000 bombing of the USS Cole. The proceedings were conducted by a military commission at Guantanamo Bay, Cuba.

The three-judge panel unanimously ruled that the military judge in the terrorism case against Abd al-Rahim al-Nashiri improperly presided over the trial at the same time he was seeking a job with the Justice Department (DOJ) as an immigration judge. In the panel's ruling, Judge David Tatel wrote that retired Air Force Col. Vance Spath's application for the DOJ position "created a disqualifying appearance of partiality" and vacated all orders issued by Spath in the case after he applied for the job in 2015.

"We cannot permit an appearance of partiality to infect a system of justice that requires the most scrupulous conduct from its adjudicators," said Tatel, who was joined in the ruling by Judges Judith Rogers and Thomas Griffith.

In a further twist, Col. Shelly Schools, who'd briefly replaced Spath, was also removed after it was revealed that she also sought to become an immigration judge.

The ruling likely means that the prosecution of al-Nashiri in the Cole bombing, which killed 17 American sailors and wounded 37 more while the vessel was being refueled in Yemen's Aden harbor, will have to begin anew. Al-Nashiri has been in U.S. custody since 2002 but was not arraigned in the Cole bombing until 2011, and the case has been delayed several times over various legal and logistical issues

Spath himself called a halt to proceedings 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. He was hired as an immigration judge last year.

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.

CLICK HERE TO GET THE FOX NEWS APP

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

The Associated Press contributed to this report.