Khalid Sheik Mohammed and four alleged co-conspirators accused of organizing the Sept. 11, 2001, attacks will be tried before a military commission at Guantanamo Bay, the Obama administration said Monday, reversing its long-held plan to bring the men to trial in federal court.

The decision scuttled one of the administration’s signature goals and signified the enduring role of Guantanamo Bay as part of the country’s counterterrorism arsenal. It may also mark the effective end of the administration’s effort, now more than two years old, to close the detention center in Cuba.

In announcing the decision, Attorney General Eric H. Holder Jr. said he will return the case to the Defense Department “reluctantly” and blamed the move on Congress, which has erected a series of barriers to bringing detainees to the United States, even for prosecution.

“As the president has said, those unwise and unwarranted restrictions undermine our counterterrorism efforts and could harm our national security,” Holder said. “Decisions about who, where and how to prosecute have always been — and must remain — the responsibility of the executive branch.”

Holder added that the Justice Department had been “prepared to bring a powerful case” against the suspects. To underscore the point, the department unsealed a December 2009 indictment on Monday that outlined the case prosecutors had planned to pre­sent. A federal judge dismissed the indictment Monday at the request of federal prosecutors.

The White House, which has played a central role in formulating Guantanamo Bay policy, did not issue a statement on the reversal and referred all questions to the Justice Department.

The five defendants will now be tried in the courtroom at Guantanamo Bay that George W. Bush’s administration built for them. They were arraigned there in 2008 and have not left the detention facility since their arrival in September 2006. But President Obama stopped their prosecution immediately after he took office and promised to close the prison within a year.

Navy Capt. John F. Murphy, the chief military prosecutor at Guantanamo Bay, said Monday that he plans to swear charges against the five men in the near future and that he will again seek to prosecute them in a joint trial.

Advocates of military trials, including some leading Republicans on Capitol Hill, said the administration had belatedly bowed to the inevitable.

“As I have been saying since Day One, these terror trials belong in a military commission at Guantanamo. I am absolutely shocked that it took Attorney General Holder 507 days to come to this realization,” said Rep. Peter T. King, (R-N.Y.), the chairman of the House Homeland Security Committee. “Today’s reversal is yet another vindication of President Bush’s detention policies by the Obama administration and is welcome news to the families of the victims of the 9/11 terrorist attacks, who will finally see long-awaited justice.”

Human rights groups questioned not only the appropriateness of the prosecution venue but also the belief that it will bring anything approaching swift justice.

“There is a reason this system is condemned: It is rife with constitutional and procedural problems,” said Anthony D. Romero, the executive director of the American Civil Liberties Union. “Cases prosecuted by the Obama administration in the commissions now are sure to be subject to continuous legal challenges and delays, and their outcomes will not be seen as legitimate.”

The defendants include Mohammed, a Pakistani born in Kuwait who is the self-proclaimed mastermind of the attacks; Ramzi Binalshibh, a Yemeni; Walid Muhammad bin Attash, a Yemeni also known as Tawfiq bin Attash; Ammar al-Baluchi, also known as Ali Abd al-Aziz Ali, a Pakistani who is Mohammed’s nephew; and Mustafa Ahmed al-Hawsawi, a Saudi.

They were held at secret prisons by the CIA and were subjected to what have been called “enhanced interrogation techniques” before they were transferred to Guantanamo Bay.

Military prosecutors, like their federal counterparts, think they can secure convictions without relying on coerced statements made to the CIA, and Holder said he has “full faith and confidence in the military-commission system to appropriately handle this case as it proceeds.”

But military defense lawyers think their clients’ treatment by the CIA will still be a critical factor mitigating against death sentences, and they plan to try to introduce as much evidence of abuse as possible.

Another unresolved key question is whether Mohammed and the others can plead guilty and receive the death penalty, something they appeared interested in doing just before Obama suspended military commissions.

In December 2008, the five sent a document to the military judge overseeing their case to “announce our confessions and plea in full.” But the judge, Army Col. Stephen R. Henley, said he wanted a briefing from the prosecution and a defense response on whether he could accept guilty pleas in a death penalty case under the language of the Military Commissions Act, which suggests that a death penalty can arise only from a decision by a military jury.

“Are you saying if we plead guilty we will not be able to be sentenced to death?” Mohammed asked at the time, before withdrawing the offer.

Rep. Howard P. “Buck” McKeon (R-

Calif.) has introduced legislation that would allow a military judge to accept a guilty plea to capital charges and then sentence the defendants to death.

Murphy, the chief military prosecutor, said: “It would be inappropriate to speculate on what specific charges may be sworn or if . . . prosecutors will seek the death penalty.”

Holder first announced in November 2009 the planned prosecution of Mohammed and his co-defendants in federal court in New York. The decision was the culmination of an almost year-long examination of the

cases of every Guantanamo Bay detainee.

But the announcement triggered almost immediate opposition from congressional Republicans, who said the attacks on New York and Washington were acts of war, not ordinary crimes, and should be prosecuted in a military tribunal.

New York Mayor Michael R. Bloomberg (I) initially supported the prosecution, but that backing faltered when fears were raised of major disruption in the life of the city and when the New York Police Department said it would cost hundreds of millions of dollars to secure Lower Manhattan.

The administration quietly shelved its plans while insisting that it was still committed to federal trials for some Guantanamo Bay detainees. Through much of the past year, the 9/11 case and other potential prosecutions of Guantanamo Bay detainees have been in limbo.

Federal law enforcement officials said the decision not to hold civilian trials was considered inevitable within the Justice Department once Congress barred the transfer of Guantanamo Bay detainees to the United States for any reason, including prosecution, which previously was possible.

“It’s fair to say that was the final nail in the coffin,’’ said one source familiar with the case, who spoke on the condition of anonymity to discuss internal deliberations. “It was just never, never going to happen.’’

Other sources said the decision had been in the works for some time before Monday but was closely held. Asked why it took four months after Congress passed the legislation, one official said: “The government is a big battleship, and it takes a while to turn it around. I wouldn’t read anything more into it than that.’’

Staff writers Jerry Markon and William Branigin and staff researcher Julie Tate contributed to this report.