The U.S. Court of Appeals for the District of Columbia Circuit ruled 2-1 that civilian courts no longer have the authority to consider whether the military is illegally holding foreigners.
Barring detainees from the U.S. court system was a key provision in the Military Commissions Act, which Mr. Bush pushed through Congress last year to set up a system to prosecute terrorism suspects.
Last year, the high court struck down the Bush administration's original plan for trying detainees before military commissions.
At the White House, deputy press secretary Dana Perino called the decision "a significant win" for the administration and said the Military Commissions Act provides "sufficient and fair access to courts for these detainees."
"We're disappointed," said Shayana Kadidal of the Center for Constitutional Rights. "The bottom line is that according to two of the federal judges, the president can do whatever he wants without any legal limitations as long as he does it offshore."
"The decision reaffirms the validity of the framework that Congress established in the MCA permitting Guantanamo detainees to challenge their detention" through military hearings coordinated by the Defense Department," said spokesman Erik Ablin.
"This is a setback for the detainees, but everyone involved in these cases knows that the real battle will be fought at the Supreme Court," said CBS News legal analyst Andrew Cohen. "This was just a necessary procedural step that had to take place before the justices agree to hear the case, which they probably will."
Under the commissions act, the government may indefinitely detain foreigners who have been designed as "enemy combatants" and authorizes the CIA to use aggressive but undefined interrogation tactics.
But most criticized by Democrats and civil libertarians was a provision that stripped U.S. courts of the authority to hear arguments from detainees who said they were being held illegally.
Attorneys argued that the detainees aren't covered by that provision and that the law is unconstitutional.
"The arguments are creative but not cogent. To accept them would be to defy the will of Congress," Judge A. Raymond Randolph wrote.
On Tuesday, a spokeswoman for Democratic Sen. Patrick Leahy, chairman of the Judiciary Committee, said he would accelerate efforts to pass a revision to the law that would restore detainees' legal rights.
Such a provision, introduced by Leahy and then-Judiciary Chairman Arlen Specter, R-Pa., narrowly failed last year on a 48-51 vote.
"The Military Commissions Act is a dangerous and misguided law that undercuts our freedoms and assaults our Constitution by removing vital checks and balances designed to prevent government overreaching and lawlessness," Leahy said in a statement.
U.S. citizens and foreigners being held inside the country normally have the right to contest their detention before a judge. The Justice Department said foreign enemy combatants are not protected by the Constitution.
Randolph and Judge David B. Sentelle ordered that the hundreds of cases pending in the lower courts be dismissed.
Judge Judith W. Rogers dissented, saying the cases should proceed.
"District courts are well able to adjust these proceedings in light of the government's significant interests in guarding national security," Rogers wrote.
But Jonathan Hafetz, an attorney at the Brennan Center for Justice, said the ruling sends the wrong message about justice to U.S. citizens and the international community.
"It's a terrible ruling that contradicts centuries of Anglo-American history and allows the indefinite detention of innocent people without charge or judicial review," he said. "It also allows for detention based on evidence gained by torture."