WASHINGTON — A panel of US Army judges ruled Thursday that a soldier accused of the Fort Hood massacre must appear in court clean-shaven, upholding a trial judge's earlier order.

Major Nidal Hasan, charged with the November 2009 shooting spree that left 13 dead at the Texas military base, had argued that he had a right to keep his beard as an expression of his Islamic faith, but the US Army Criminal Court of Appeals sided with the judge overseeing his court-martial.

The court concluded that the trial judge, Colonel Gregory Gross, was correct in finding the Religious Freedom Restoration Act "does not provide Hasan the right to wear a beard while in uniform during his upcoming court martial," according to a US Army statement.

The judges agreed that "Hasan did not prove his beard was an expression of a sincerely held religious belief," it said.

"Additionally, the court went on to say that even if Hasan did wear the beard for a sincere religious reason, compelling government interests also justified (judge) Gross's order requiring Hasan to comply with Army grooming standards," it said.

Under military rules, soldiers are not allowed to wear beards and the trial judge had repeatedly found Hasan in contempt of court for defying an order to shave off his facial hair.

The court also upheld the trial judge's contempt proceedings against Hasan, who was fined $1,000 in six separate rulings for appearing with a beard.

Two judges on the seven-member panel wrote "a partial dissent," arguing the trial judge's order compromised his impartiality, the statement said.

Hasan's defense lawyers have indicated they will appeal the ruling to the military's highest court, the US Court of Appeals for the Armed Forces.

The argument over Hasan's beard has held up his court-martial, which was originally due to get under way in August.

Hasan, a US Army psychiatrist, is accused of opening fire at the Fort Hood base on November 5, 2009, in an attack that killed 12 soldiers and a civilian, and wounded 32 others.

His court-martial is due to take place in Texas and if convicted, Hasan could face a death sentence.