A Guantánamo Bay prisoner charged with aiding the 9/11 attack was ejected twice Tuesday from a pretrial hearing at the naval base after he ignored warnings and kept trying to address the court about alleged mistreatment inside his high-security prison cell.

Ramzi bin al-Shibh, one of five Guantánamo prisoners facing a war crimes tribunal for their alleged roles in the terrorist attack, was escorted out of the court in the morning and again in the afternoon session at the orders of the military judge, army Colonel James Pohl.

The judge, in both cases, was asking the defendant to acknowledge his right to be absent during the weeklong pretrial hearing. The other four defendants all answered in the affirmative, but Bin al-Shibh refused, trying to turn the question into an opportunity to repeat previous allegations that guards were making banging noises throughout the night in a deliberate effort to prevent him from sleeping inside Camp 7, the highest-security section of the prison on the US base in Cuba.

Pohl warned another ejection could happen Wednesday when Bin al-Shibh returns for the third day of the hearing. "If he is disruptive, he will be escorted from the courtroom," he said.

Earlier, the judge suggested to Bin al-Shibh's lawyer, navy Lieutenant Commander Kevin Bogucki, that he may need a mental evaluation. The lawyer said his client is "not delusional," and that lack of sleep inhibits his ability to participate in his defense.

Bin al-Shibh, a Yemeni, kept trying to speak over the judge Tuesday morning, saying at one point that "my life is in danger," before the judge ordered him removed.

The court is hearing pretrial motions to resolve preliminary legal issues in a hearing scheduled to run through Friday.

Bin al-Shibh and his co-defendants face charges that include murder and hijacking and could get the death penalty if convicted. A trial date has not been set.