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.

Nov. 9: In this sketch by courtroom artist Janet Hamlin, reviewed by the U.S. military, Abd al-Rahim al-Nashiri is seen during his military commissions arraignment at the Guantanamo Bay.

Abd al-Rahim al-Nashiri has been in U.S. custody since 2002. (AP)

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.

FILE - In this Sunday, Oct. 15, 2000 file photo, investigators in a speed boat examine the hull of the USS Cole at the Yemeni port of Aden, after a powerful explosion ripped a hole in the U.S Navy destroyer, killing at least 17 sailors and injuring some 30 others. Poland is paying a quarter of a million dollars to terror suspects Abd al-Rahim al-Nashiri, a Saudi national accused in the 2000 bombing of the USS Cole warship and a second terror suspect Abu Zubaydah, who were allegedly tortured by the CIA in a secret facility in Poland - prompting outrage among many here who feel they are being punished for American wrongdoing. (AP Photo/Dimitri Messinis, file)

The USS Cole bombing killed 17 sailors and injured 37 others in October 2000.  (AP Photo/Dimitri Messinis, file) (The Associated Press)

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.