The special trials established to determine the guilt or innocence of prisoners at the U.S. military prison in Cuba are unlawful and cannot continue in their current form, a federal judge ruled yesterday.

In a setback for the Bush administration, U.S. District Judge James Robertson found that detainees at the Navy base at Guantanamo Bay, Cuba, may be prisoners of war under the Geneva Conventions and therefore entitled to the protections of international and military law -- which the government has declined to grant them.

The decision came in a lawsuit filed by the first alleged al Qaeda member facing trial before what the government calls "military commissions." The decision upends -- for now -- the administration's strategy for prosecuting hundreds of alleged al Qaeda and Taliban detainees accused of terrorist crimes.

Human rights advocates, foreign governments and the detainees' attorneys have contended that the rules governing military commissions are unfairly stacked against the defendants. But Robertson's ruling is the first by a federal judge to assert that the commissions, which took nearly two years to get underway, are invalid.

The Bush administration denounced the ruling as wrongly giving special rights to terrorists and announced that it will ask a higher court for an emergency stay and reversal of Robertson's decision. Military officers at Guantanamo immediately halted commission proceedings in light of the ruling.

"We vigorously disagree. . . . The judge has put terrorism on the same legal footing as legitimate methods of waging war," said Justice Department spokesman Mark Corallo. "The Constitution entrusts to the president the responsibility to safeguard the nation's security. The Department of Justice will continue to defend the president's ability and authority under the Constitution to fulfill that duty."

Robertson ruled that the military commissions, which Bush authorized the Pentagon to revive after the Sept. 11, 2001, attacks, are neither lawful nor proper. Under commission rules, the government could, for example, exclude people accused of terrorist acts from some commission sessions and deny them access to evidence, which the judge said would violate basic military law.

Robertson said the government should have held special hearings for detainees to determine whether they qualified for prisoner-of-war protections when they were captured, as required by the Geneva Conventions. Instead, the administration declared the captives "enemy combatants" and decided to afford them some of the protections spelled out by the Geneva accords.

Robertson ordered that until the government provides the hearing, it can prosecute the detainees only in courts-martial, under long-established military law.

Robertson issued his decision in the case of Salim Ahmed Hamdan, a detainee captured in Afghanistan in late 2001 and accused of being a member of al Qaeda. Robertson's opinion is expected to set the standard for treatment of other detainees before military commissions. So far, four Guantanamo Bay detainees have been ordered to stand trial.

The unusual coalition of defense lawyers and conservative military law experts who banded together to challenge the commissions hailed the decision as a major victory in efforts to level the playing field for the detainees, some of whom have been held for nearly three years.

"We are thrilled by this ruling," said Michael Ratner, president of the Center for Constitutional Rights, a New York-based group that represents the families of some Guantanamo Bay prisoners. "Military commissions were a bad idea and an embarrassment. The refusal of the Bush administration to apply the Geneva Conventions was a legal and moral outrage."

Kevin Barry, a retired Coast Guard judge who is critical of the Pentagon's legal justifications for the Guantanamo Bay detentions, called Robertson's ruling a "remarkable" decision that "will give heart to all who think the rule of law should apply in the Afghanistan conflict." Barry said the war on terrorism is the first U.S. war since the Geneva Conventions' adoption in 1949 in which the government has not accorded POW status to enemy fighters.

"Even the Viet Cong, who were farmers by day and fighters at night, were accorded that status," he said. "The judge got these issues right."

The government has been under pressure since June to revise other facets of its strategy for handling the cases of the more than 500 Guantanamo Bay detainees. In a landmark ruling that month, the Supreme Court rejected the government's argument that the president may indefinitely hold and interrogate alleged al Qaeda and Taliban members captured on the battlefield without filing charges or providing them lawyers.

The court ruled that the detainees were entitled to hear the charges against them and challenge their imprisonment in U.S. federal courts. Nearly 70 have filed such challenges, called habeas corpus petitions, in federal courts here.

Since the Supreme Court ruling, the government has begun holding "combatant status review tribunals" at Guantanamo Bay for each detainee to determine whether he should continue to be held. The detainees do not have legal representation at those hearings. So far 317 hearings have been held and 131 cases have been adjudicated, all but one in favor of continued detention.

Douglass Cassel, director of the Center for International Human Rights at the Northwestern University School of Law, said he hopes the Bush administration reconsiders its overall strategy in light of the Supreme Court's June decision and Robertson's ruling yesterday.

"I hope the government sits back and says, 'This is a chance to regain the high ground in the court of public opinion,' " he said. "This decision is of enormous importance to the perceived commitment of the United States to the rule of law."

But Douglas W. Kmiec, a Pepperdine University law professor, called Robertson "sadly mistaken" for intervening in the case at this point. He said the judge should have postponed any ruling until the military commissions had completed their work.

Eugene R. Fidell, a Washington lawyer specializing in military justice, said it will be difficult for military commissions and status review panels to decide fairly whether a detainee is a prisoner of war, after top executive branch and military leaders have declared all of them enemy combatants, not POWs.

"That's where they got into trouble," Fidell said. "The people driving the train were not people familiar with the military justice system."

A U.S. Army soldier stands guard at Camp Delta at Guantanamo Naval Base, where some detainees have been held for nearly three years.