Reuters U.S. Army Major Nidal Hasan, charged with killing 13 people and wounding 31 in a November 2009 shooting spree at Fort Hood, will have to shave his beard, a military court has ruled.

A U.S. military court ruled on Thursday that Fort Hood shooting suspect Major Nidal Hasan must shave his beard before appearing for court martial on murder charges connected to the November, 2009 massacre.

"In front of a military panel, it is undeniable that failure to comply with Army grooming regulations would cast him in a negative light," a majority of judges on the U.S. Army Court of Criminal Appeals ruled. "The military judge has the authority to prescribe the proper uniform for trial."

Hasan, 42, argued that he has a beard because of his Muslim beliefs and requiring him to shave it would amount to religious discrimination.

Hasan faces the death penalty or life in prison without parole if convicted in the Nov. 5, 2009, attack that killed 13 people and wounded more than two dozen others at the Army post about 130 miles southwest of Dallas.

His trial has been on hold for months while the issue of his beard was adjudicated.

Hasan's attorneys also want the appeals court to overturn six contempt-of-court rulings Col. Gregory Gross issued against Hasan for having a beard at pretrial hearings this past summer, when he first showed up in court with facial hair.

Army grooming standards prohibit beards but allow for religious exceptions. Gross denied Hasan's request for such an exception. He found that Hasan's claims of religious sincerity did not outweigh prosecutor's arguments that Hasan grew the beard just before his August trial date so witnesses wouldn't be able to identify him in court.

At an Oct. 11 hearing, defense attorney Capt. Kristin McGrory said military judges have no authority to order forcible shaving. She said military regulations authorize it for inmates only for safety and health reasons.

McGrory also disputed Gross' assertion that the beard would be a disruption during Hasan's trial.

"The fact that he's wearing a beard does not materially interfere with the course of the trial," she told the panel of judges.

The Associated Press and Reuters contributed to this story.

More content from NBCNews.com:

Follow US news from NBCNews.com on Twitter and Facebook