The accused mastermind of the worst terror attack in U.S. history told a Guantanamo Bay military judge on Thursday that he wants to be put to death so he can become a martyr.

Khalid Sheikh Mohammed also sang verses from the Koran, rejected his attorneys and told Judge Ralph Kohlmann, a Marine colonel, that he wants to represent himself at the war crimes trial. The judge warned that he faces execution if convicted of organizing the attacks on America. But the former No. 3 leader of Al Qaeda was insistent.

"Yes, this is what I wish, to be a martyr for a long time," Mohammed declared. "I will, God willing, have this, by you."

One of Mohammed's co-defendants, Ramzi Binalshibh, told the court his fate is in the hands of God.

"I am guilty," Binalshibh said. "I have been seeking martyrdom for five years."

Mohammed and four alleged co-conspirators each face death if convicted of war crimes including murder, conspiracy, attacking civilians and terrorism by hijacking planes to attack U.S. landmarks. The murder charges involve the deaths of 2,973 people at the World Trade Center, Pentagon and a field in Pennsylvania where passengers forced down their plane.

• Click here to view photos.

Mohammed wore thick glasses and a turban and stroked a bushy gray beard, in stark contrast to the disheveled hair, unshaven face and T-shirt he was in during his capture in Pakistan in 2003. Mohammed later was held in CIA custody at secret sites and transferred to the U.S. Navy base in Guantanamo Bay, Cuba, in 2006.

Appearing calm as he propped his glasses on his turban to peer at legal papers, Mohammed also grinned and exchanged a few words with someone at the defense table occupied by Waleed bin Attash, who allegedly selected and trained some of the 19 hijackers who turned airplanes into missiles in the attacks.

Their arraignment is the highest-profile test of the controversial tribunal system, which is being challenged before the U.S. Supreme Court.

U.S. military officials told Reuters the suspects, all dressed in cream-colored clothing and turbans, willingly walked into the courtroom.

Journalists were allowed to see the proceedings on closed-circuit TV in a nearby press room. Other observers including Fang Wong, a senior member of the American Legion, filed into the tightly guarded courthouse to watch the arraignment.

"I'm from the New York area, and I have been waiting for this for a long time," Wong said as he waited to be searched by soldiers before entering the court complex.

Attorney General Michael Mukasey on Wednesday said the tribunals will be "in the best traditions of the American legal system" even though the military judges can consider hearsay evidence and confessions obtained through coercion, which aren't admissible in civilian courts.

"Different situations call for different solutions," he said.

Along with Mohammed, the other four defendants are Binalshibh, said to have been the main intermediary between the hijackers and Al Qaeda leaders; Ali Abd al-Aziz Ali, known as Ammar al-Baluchi, a nephew and lieutenant of Khalid Sheikh Mohammed; al-Baluchi's assistant, Mustafa Ahmad al-Hawsawi; and Attash.

The Associated Press contributed to this report.