WASHINGTON
— President Bush acted beyond his constitutional authority as commander in chief when he ordered the indefinite detention of "enemy combatants" seized on a foreign battlefield without giving them access to US courts.

In a day of landmark decisions at the US Supreme Court dealing with the war on terror, the justices ruled that so-called enemy combatants are entitled to access to US courts whether they are being held in a military brig within the US or at a terrorism prison camp at Guantánamo Bay, Cuba.

The rulings amount to a major setback for President Bush and his legal advisers, who have sought to promote a more robust application of the president's powers as commander in chief in response to the terror attacks of Sept. 11.

In a third potential landmark case, the nation's highest court declined on jurisdictional grounds to determine whether the same principles should apply to the open-ended jailing of American citizens who are seized on US soil as enemy combatants.

In the two major decisions handed down Monday, the high court invalidated two highly controversial tactics being deployed by the Bush administration in the war on terror - the indefinite detention of US-born Yaser Hamdi with only limited access to the courts, and the continued holding of hundreds of detainees at a terrorism prison camp at Guantánamo Bay, Cuba, with no access to US courts.

"We reaffirm today the fundamental nature of a citizen's right to be free from involuntary confinement by his own government without due process of law," Justice Sandra Day O'Connor writes for the majority in Mr. Hamdi's case. "A state of war is not a blank check for the president when it comes to the rights of the nation's citizens."

In the Guantánamo Bay detainee cases, Justice John Paul Stevens wrote for the majority that foreign nationals being held by the military overseas but within US jurisdiction must be given access to US federal courts.

Nothing in US law "excludes aliens detained in military custody outside the United States from the privilege of litigation in US courts," Justice Stevens says.

In a dissent, Justice Antonin Scalia calls the majority's decision in the Guantánamo Bay case "judicial adventurism of the worst sort."

"The court springs a trap on the executive, subjecting Guantanamo Bay to the oversight of the federal courts even though it has never before been thought to be within their jurisdiction - and thus making it a foolish place to have housed alien wartime detainees," Justice Scalia writes.

In the third case confronted by the court, the justices declined to address whether Jose Padilla, a US citizen seized on American soil, can be held indefinitely without charge in military custody after being designated an enemy combatant. But the court's ruling in Mr. Hamdi's case effectively answers that question.

The president as commander in chief has the power to detain enemy combatants, but he does not have the power to prevent them from challenging their detention in a federal court.

"We necessarily reject the government's assertion that separation of powers principles mandate a heavily circumscribed role for the courts," says Justice O'Connor.

She adds, "It would turn our system of checks and balances on its head to suggest that a citizen could not make his way to court with a challenge to the factual basis for his detention by his government."

In the Padilla case, the justices ruled 5 to 4 that Padilla's lawyers filed their lawsuit in the wrong court. Instead of a federal court in New York City, the lawyers should have filed suit in Charleston, S.C., where Padilla is being held in a military brig.

The court's actions constitute a major victory for civil libertarians and human rights advocates who have denounced the president's antiterror tactics as a substantial erosion of fundamental American freedoms.

"This is a sweeping victory for the rule of law," says Deborah Pearlstein, director of the US Law and Security Program at Human Rights First in Washington, D.C.

The decisions come amid heightened national debate over alleged prisoner abuses in military detention facilities in Iraq, Afghanistan, and Guantánamo Bay, Cuba. The debate has been further fueled by leaked memos reflecting considerations within the Bush administration over the possible use of torture, disclosures that could not have helped the administration's efforts before the high court.

"Before Abu Ghraib, the government was saying, 'Trust the executive, the other branches have no role,' " says Harold Koh, dean of Yale Law School. "Now the court responds, 'Yes, Congress must authorize and the courts must review.' "

Mr. Koh adds, "They've completely rejected the notion that the president should be allowed to handle this alone."

In the Hamdi case, the high court ruled 6 to 3 that Hamdi, a US citizen captured on an Afghanistan battlefield and ordered indefinitely detained within the US, must be provided a meaningful opportunity to challenge the government's action in a US court.

In the Guantánamo Bay case, the justices ruled 6 to 3 that foreign enemy combatants being held at the US naval base at Guantánamo Bay, Cuba, must be afforded the opportunity to challenge in US courts their open-ended detention.

The jurisdiction decision in the Padilla case overturns a ruling by the Second US Circuit Court of Appeals in New York City declaring that President Bush had no authority to order the indefinite detention of Padilla as an enemy combatant. The appeals court had ordered Padilla's release.

Padilla is suspected of plotting with Al Qaeda leaders to carry out a nuclear dirty-bomb attack or other acts of terror within the US. He was initially held under a material witness warrant in New York. But just as his appointed counsel arranged a court hearing on his behalf, Bush designated Padilla an enemy combatant, and he was transferred to a military brig near Charleston.

The decisions allow the Bush administration to continue to deal with those it considers enemy combatants but mandates that they must submit to judicial review.

Critics view the administration's approach as having created a "legal black hole" in which to toss "enemy combatants," regardless of whether they are foreign nationals captured on a foreign battlefield or American citizens seized on American streets.

Hamdi was captured in Afghanistan in the fall of 2001 and held at the detention facility at Guantánamo Bay, Cuba. When US officials discovered that Hamdi, a Saudi citizen, had been born in the US and thus qualified for automatic US citizenship, he was transferred to a military brig in Virginia. He was later shifted to a brig in South Carolina.

A federal appeals court panel in Richmond upheld his open-ended detention and said that while he was entitled to challenge his confinement in a federal court, judges in such cases must be highly deferential to the concerns of the president.

In overturning the appeals court in the Hamdi case, the majority justices said Hamdi is entitled to a more complete and probing review of his case than authorized by the appeals court.

The Guantánamo Bay ruling is likely to trigger a barrage of legal challenges. It remains unclear what legal standards will apply and what relief a court may order.

Currently there are 595 foreign nationals being held in indefinite detention without charge at a specially built prison at Guantánamo Bay, Cuba.

Lawyers acting on behalf of 14 of the detainees - two Australians and 12 Kuwaitis - filed two lawsuits challenging the legality of their confinement, arguing that federal law, the Constitution, and international human rights agreements mandate that there be an appeal process to prevent the detention of innocent individuals.

A federal appeals court in Washington, D.C., ruled that their cases could not be heard in US courts because federal judges lacked jurisdiction over foreign nationals being detained by the military outside the sovereign territory of the United States.