The Obama administration in 2009 cleared 126 detainees for transfer out of the U.S. military prison at Guantanamo Bay, Cuba. As they began flying off, to either their home nations or others for resettlement, a sense of optimism pulsed through the camps.

But those releases have ground to a halt because of congressional restrictions and decisions by President Obama that have left dozens of detainees in limbo. The executive branch told them they would leave; the legislative branch has blocked their movement.

That is the curious backdrop as the administration prepares to restart military commission proceedings Wednesday with a case against an al-Qaeda member — one of three detainees waterboarded in CIA custody — accused of plotting the 2000 bombing of the USS Cole in Yemen.

“It’s beyond frustrating. There’s a kind of hopelessness and cruelty,” said Cori Crider, a lawyer for the London-based charity Reprieve, which represents a number of detainees.

The earlier departures included 67 detainees, with 27 going home; 38 resettling in third countries, mostly in Europe; and two being sent to Italy for prosecution. No one, however, has left since January, when a federal judge ordered an Algerian man released. The administration on its own authority has not been able to transfer any detainees since September 2010, when a Palestinian and a Syrian were sent to Germany.

One exit door at Guantanamo shut in early 2010 after the attempted bombing of a commercial airliner by a Nigerian man with a bomb in his underwear. Umar Farouk Abdulmutallab, who pleaded guilty to terrorism charges in Detroit last month, was recruited and trained by al-Qaeda’s affiliate in Yemen, where the bomb was built. After the failed attack, the Obama administration suspended the transfer home of any more of the 29 Yemenis who had been cleared for repatriation.

But detainees from other countries continued to leave Guantanamo, until Congress passed restrictions as part of the 2011 National Defense Authorization Act. One critical provision demanded that the defense secretary certify that he would “ensure” that a freed “individual cannot engage or re-engage in any terrorist activity.”

“This provision is onerous and near impossible to satisfy,” said Jeh Johnson, the Defense Department’s general counsel, in a speech last month at the Heritage Foundation. The degree of recidivism among Guantanamo detainees remains a matter of dispute, and the Pentagon has not released the names of those who it alleges have returned to the fight.

The provision has stranded most of the 32 detainees who were on track to be transferred when Congress acted. This group includes five Chinese Uighurs ordered released by the courts; the administration has not been able to find a country where they want to go.

The administration refuses to release to the public the names of those cleared for transfer, even though the detainees themselves, and in many cases their families, have been told of their status.

Lawyers for the detainees insist that the administration still has options to continue its stated policy of reducing the population at Guantanamo Bay and, ultimately, closing the facility. The congressional restrictions do not bar the administration from transferring someone who has been ordered released by a federal court. In 2010, the Obama administration lifted its ban on returning Yemenis home to repatriate one man after a court ruled that there was “overwhelming” evidence that he had been wrongfully detained.

J. Wells Dixon, a senior staff lawyer at the Center for Constitutional Rights, which represents a number of Guantanamo detainees, said the government could stop contesting the habeas corpus petitions of those detainees it wants to transfer. And, without admitting error, the government, in conjunction with a detainee’s lawyers, he said, could ask the court to enter an order disposing of the case and directing the release of the detainee.

Dixon also said the administration could seek plea agreements in military commissions. Defense Secretary Leon E. Panetta, for instance, is expected to certify that Omar Khadr, a Canadian citizen, can be repatriated after a plea agreement in which he pleaded guilty to war crimes last year.

“Detainees would line up” to make similar plea deals if there were a chance to get out of Guantanamo, Dixon said.

But a government official, who spoke on the condition of anonymity because he was not authorized to discuss Guantanamo policy publicly, said the administration will not try to defy Congress by attempting to circumvent the restrictions — at least not yet.

“It’s the kind of sleight of hand that in the current political climate could get you in a lot of trouble,” the official said. “At the moment, it’s better to be straight than be clever. The legislation is not fixed, and you can imagine the process picking up again.”

The current restrictions expire at the end of the year. Senior Democrats on the Senate’s Intelligence and Judiciary committees have expressed concern about renewed Guantanamo restrictions, even though they came out of the Armed Services Committee with bipartisan support. The new National Defense Authorization Act would include them, but there has also been some conservative opposition to extending them.

“Does the proposed legislation support and respect the President’s executive power under the Constitution to prosecute the war as he sees fit, or does it impose inflexible and unnecessary restrictions on him?” asked Charles Stimson, a Pentagon official in the Bush administration, in a memo published by the Heritage Foundation.

He said the president should be able to decide on the “detention, release, transfer, review, and forum for prosecution of the enemy.”

Staff researcher Julie Tate contributed to this report.