SAN ANTONIO, Texas — A US soldier accused of killing 13 people at a Texas army base has tried to plead guilty, but the judge refused to accept it and the trial was unexpectedly adjourned until next week.

Major Nidal Hasan, a former army psychiatrist, is accused of carrying out the November 2009 shooting rampage at Fort Hood, an attack that raised fears of homegrown extremism and Al-Qaeda recruitment within the armed forces.

The American of Palestinian heritage tried to plead guilty on 13 counts of premeditated murder, but Colonel Gregory Gross, who is hearing the case, said military law does not allow for guilty pleas in death penalty trials.

Gross entered a not guilty plea instead.

The United States Court of Appeals for the Armed Forces meanwhile delayed the trial until Monday so it could review a confrontation between the judge and Hasan, who has grown a beard in violation of Army regulations.

Gross has said he wants Hasan to be in court for the trial, and that if he does not shave his beard, soldiers will be ordered to shave it for him.

The US Constitution generally allows the accused to confront witnesses and evidence in trial, but there have been cases where defendants are removed from the courtroom due to unruly behavior.

Witnesses to the shooting -- mostly soldiers preparing to deploy to Afghanistan -- said they saw Hasan jump on a desk in a crowded deployment facility and cry out, "Allahu Akbar!", Arabic for God is greatest.

Testifying in an earlier evidentiary hearing, they said he then began firing at them with a pair of handguns fed with extended-round clips.

Wednesday's plea attempt may have been part of a risky gambit to hamper the prosecution's efforts to bring witnesses to the stand, according to Geoffrey Corn, a military law expert at the South Texas College of Law in Houston.

"They could still call the witnesses in sentencing, but it's a dilemma," Corn said, adding that prosecutors would then have to explain why they were prolonging the trial after Hasan admitted guilt.

Corn said the appeals court could settle the beard issue in a matter of days. "They're going to do everybody a favor" by settling it now, rather than after the trial ends and the appeals process begins, he said.

The FBI alleges Hasan had contacts with firebrand US-born preacher Anwar al-Awlaqi, a key leader of Al-Qaeda in the Arabian Peninsula who was killed in a September 2011 drone strike.

Hasan -- who had been set to deploy to Afghanistan weeks after the attack -- was shot by police officers trying to halt the carnage and left paralyzed from the neck down.

[Silhouette Of Us Soldier via Shutterstock]