GUANTANAMO BAY NAVAL BASE, Cuba (AP) — The self-proclaimed mastermind of the Sept. 11 attacks repeatedly declined to respond to a judge’s questions Saturday and his co-defendant was briefly restrained at a military hearing as five men charged with the worst terror attack in US history appeared in public for the first time in more than three years.

Khalid Sheikh Mohammed and his co-defendants appeared for arraignment at a military tribunal at Guantanamo Bay on charges that include 2,976 counts of murder for the 2001 attacks.

The hearing quickly bogged down before they could be arraigned as the men engaged in what appeared to be a concerted silent protest against the proceedings.

Mohammed and his co-defendants took off the earphones that provide Arabic translations and refused to answer any questions from the judge, Army Col. James Pohl, dramatically slowing a hearing that is heavy on military legal procedure.

At one point, two of the men got up and prayed alongside their defense tables under the watchful eyes of troops arrayed along the sides of the high-security courtroom on the US base in Cuba.

Prisoner Walid bin Attash was put in a restraint chair for unspecified reasons and then removed from it after he agreed to behave; and lawyers for all defendants complained that the prisoners were prevented from wearing the civilian clothes of their choice.

Mohammed wore a white turban in court; his flowing beard, which had appeared to be graying in earlier hearings and photos, was streaked with red henna.

Mohammed’s civilian lawyer, David Nevin, said he believed Mohammed was not responding because he believes the tribunal is unfair.

Jim Harrington, a civilian attorney for Yemeni defendant Ramzi Binalshibh, said his client would not respond to questions ‘‘without addressing the issues of confinement.’’ No further explanation was given.

Pohl warned he would not permit defendants to block the hearing and would continue without his participation.

‘‘One cannot choose not to participate and frustrate the normal course of business,’’ Pohl said.

He addressed the earpiece issue by bringing the translators into the courtroom to translate out loud and attempted to stick to the standard script for tribunals, asking the defendants if they understood their rights to counsel and would accept the attorneys appointed for them. The men did not respond, not even to acknowledge that they understood the questions.

Through much of the session, the defendants seemed to be trying to give the impression they were in a different world than the rest of the court.

Cheryl Bormann, a civilian attorney for bin Attash, appeared in a conservative Islamic outfit that left only her face uncovered and she asked the court to order other women present to wear ‘‘appropriate’’ clothing so that defendants do not have to avert their eyes ‘‘for fear of committing a sin under their faith.’’

And Binalshibh interrupted the session with an outburst from the defense table in a mix of Arabic and broken English, saying, ‘‘Maybe they will kill me and say I committed suicide.’’

In the past, during the failed first effort to prosecute them at the US base in Cuba, Mohammed has mocked the tribunal and said he and his co-defendants would plead guilty and welcome execution. But there were signs that at least some of the defense teams were preparing for a lengthy fight, planning challenges of the military tribunals and the secrecy that shrouds the case.

The arraignment is ‘‘only the beginning of a trial that will take years to complete, followed by years of appellate review,’’ attorney James Connell, who represents defendant Ali Abd al-Aziz Ali, told reporters gathered at the base to observe the hearing.

‘‘I can’t imagine any scenario where this thing gets wrapped up in six months,’’ Connell said.

Defendants in what is known as a military commission typically do not enter a plea during their arraignment. Instead, the judge reads the charges, makes sure the accused understand their rights and then moves on to procedural issues. Lawyers for the men said they were prohibited by secrecy rules from disclosing the intentions of their clients.

Harrington, representing Binalshibh, who has said at one hearing that he was proud of the Sept. 11 attacks, said he did not think that any of the defendants would plead guilty, notwithstanding their earlier statements.

Army Capt. Jason Wright, one of Mohammed’s Pentagon-appointed lawyers, declined to comment on the case.

As in previous hearings, a handful of people who lost family members in the attacks were selected by lottery to travel to the base to watch the proceedings. Other family members were gathering at military bases in New York and across the East Coast to watch the proceedings live on closed-circuit video.

Family members at Guantanamo said they were grateful for the chance to see a case they believe has been delayed too long.

Cliff Russell, whose firefighter brother Stephen died responding to the World Trade Center, said he hoped the case would end with the death penalty for the five Guantanamo Prisoners.

‘‘I'm not looking forward to ending someone else’s life and taking satisfaction in it, but it’s the most disgusting, hateful, awful thing I ever could think of if you think about what was perpetrated,’’ Russell said.

Suzanne Sisolak of Brooklyn, whose husband Joseph was killed in his office in the trade center’s north tower, said she is not concerned about the ultimate outcome as long as the case moves forward and the five prisoners do not go free.

‘‘They can put them in prison for life. They can execute them,’’ Sisolak said. ‘‘What I do care about is that this does not happen again. They need to be stopped. That’s what I care about because nobody deserves to have this happen to them.’’

The arraignment for the five comes more than three years after President Barack Obama’s failed effort to try the suspects in a federal civilian court and close the prison at the US base in Cuba.

Attorney General Eric Holder announced in 2009 that Mohammed and his co-defendants would be tried blocks from the site of the destroyed trade center in downtown Manhattan, but the plan was shelved after New York officials cited huge costs to secure the neighborhood and family opposition to trying the suspects in the US.

Congress then blocked the transfer of any prisoners from Guantanamo to the US, forcing the Obama administration to refile the charges under a reformed military commission system.

New rules adopted by Congress and Obama forbid the use of testimony obtained through cruel treatment or torture. Gen. Mark Martins, the chief prosecutor, said the commission provides many of the same protections that defendants would get in civilian court. ‘‘I'm confident that this court can achieve justice and fairness,’’ he said.

But human rights groups and the defense lawyers say the reforms have not gone far enough and that restrictions on legal mail and the overall secret nature of Guantanamo and the commissions makes it impossible to provide an adequate defense.

They argue that the US has sought to keep the case in the military commission to prevent disclosure of the harsh treatment of prisoners such as Mohammed, who was waterboarded 183 times and subjected to other measures that some have called torture.

Mohammed, a Pakistani citizen who grew up in Kuwait and attended college in Greensboro, North Carolina, has admitted to military authorities that he was responsible for the Sept. 11 attacks ‘‘from A to Z,’’ as well as about 30 other plots, and that he personally killed Wall Street Journal reporter Daniel Pearl. Mohammed was captured in 2003 in Pakistan.

His four co-defendants include Binalshibh, who was allegedly chosen to be a hijacker but couldn’t get a US visa and ended up providing assistance such as finding flight schools; bin Attash, also from Yemen, who allegedly ran an al-Qaida training camp in Afghanistan and researched flight simulators and timetables; Mustafa Ahmad al-Hawsawi, a Saudi accused of helping the hijackers with money, Western clothing, traveler’s checks and credit cards; and al-Aziz Ali, a Pakistani national and nephew of Mohammed, who allegedly provided money to the hijackers.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.