FORT WORTH, Texas (AP) — The military's highest court ousted the judge in the Fort Hood shooting case Monday and threw out his order to have the suspect's beard forcibly shaved before his court-martial.

The U.S. Court of Appeals for the Armed Forces ruled that Col. Gregory Gross didn't appear impartial while presiding over the case of Maj. Nidal Hasan, who faces the death penalty if convicted in the 2009 shootings on the Texas Army post that killed 13 people and wounded more than two dozen others.

But the court said it was not ruling on whether the judge's order violated Hasan's religious rights. Hasan has argued that his beard is a requirement of his Muslim faith, although facial hair violates Army regulations.

"Should the next military judge find it necessary to address (Hasan's) beard, such issues should be addressed and litigated anew," judges wrote in the ruling.

Hasan appealed after Gross ordered that he must be clean-shaven or be forcibly shaved before his court-martial, a military trial.

The court-martial had been set to begin three months ago but has been on hold pending the appeals.

In a statement issued Monday night, Fort Hood officials said proceedings in the case will resume after a new judge is appointed by the Army's highest legal branch. That indicates Army prosecutors will not appeal this ruling to the U.S. Supreme Court.

An Army appeals court had upheld the shaving requirement in October. But on Monday, the U.S. Court of Appeals for the Armed Forces said the command, not the judge, was responsible for enforcing grooming standards. The ruling said that was one example of how Gross did not appear impartial in the case.

Gross had repeatedly said Hasan's beard was a disruption to the court proceedings, but the military appeals court ruled that there was insufficient evidence to show that his beard interfered with the hearings.

Gross found Hasan in contempt of court at six previous pretrial hearings because he was not clean-shaven, then sent him to a nearby trailer to watch the proceedings on a closed-circuit television. The appeals court's ruling also vacated the contempt of court convictions.

At a June hearing, lead defense attorney Lt. Col. Kris Poppe said the judge showed a bias against Hasan when he asked defense attorneys to clean up a court restroom after Gross found a medical waste bag, adult diaper and what appeared to be feces on the floor after a previous hearing. Hasan, who is paralyzed from the waist down after being shot by police the day of the shootings, has to wear adult diapers — but the mess in the restroom that day was mud from a guard's boots, Poppe said.

"In light of these rulings, and the military judge's accusations regarding the latrine, it could reasonably appear to an objective observer that the military judge had allowed the proceedings to become a duel of wills between himself and (Hasan) rather than an adjudication of the serious offenses with which (Hasan) is charged," judges wrote in the ruling.