Seven retired federal judges from both political parties have joined dozens of Guantanamo Bay detainees in urging an appeals court to declare key parts of President Bush's new anti-terrorism law unconstitutional.

The judges, in a rare court filing Wednesday, said stripping courts of the right to question how the military handles terrorism suspects "challenges the integrity of our judicial system" and effectively sanctions the use of torture.

Bush signed a law this month allowing the military to arrest people overseas and detain them indefinitely without allowing them to use the U.S. courts to contest their detention. Bush hailed the law, which established a system of military trials, as a crucial tool in the war on terrorism and said it would allow prosecution of several high-level terror suspects.

For detainees challenging their imprisonment, the law locks them out of the civilian court system. Dozens of detainees argued Wednesday that the law is unconstitutional, and the retired judges echoed that in their own papers filed with the U.S. Court of Appeals for the District of Columbia Circuit.

"We believe that compelling this court to sanction executive detentions based on evidence that has been condemned in the American legal system since our nation's founding erodes the vital role of the judiciary in safeguarding the rule of law," the judges wrote.

The brief was filed by retired Judges Shirley M. Hufstedler, Nathaniel R. Jones, George N. Leighton, Timothy K. Lewis, Frank J. McGarr, Abner J. Mikva and Patricia M. Wald. Three of the judges -- Leighton, Lewis and McGarr -- were appointed by Republican presidents.

Though Congress banned the use of torture in the military commission law, the judges said military documents revealed evidence of torture that officials didn't properly address.

In one instance cited in court documents, a man who denied receiving artillery training said an interrogator beat him until he bled from his head.

"I was in a lot of pain, so I said I had the training," the man said, according to a transcript cited in court documents. "At that point, if he had asked me if I was Usama Bin Ladin, I would have said yes."

Without the court system, the judges said, there is no check on such behavior.

In their own court filings, lawyers for the detainees argued that the law is unconstitutional because it prevents people from challenging their detention in U.S. courts -- a right that attorneys said the framers of the Constitution never would have allowed to be stripped.

"Persons imprisoned without charge must retain the right to obtain a court inquiry into the factual and legal bases for their imprisonment," attorneys wrote.

This argument echoes a Supreme Court ruling in June in which the justices ruled that the Bush administration's system for trying enemy combatants violated U.S. and international law.

Within weeks, the president persuaded Congress to pass a law setting up military commissions and barring detainees from using the civilian court system. Shortly after the law was signed, the Justice Department told hundreds of detainees that their cases in the U.S. courts had been rendered moot.

Supporters of the law compare military detainees to prisoners of war, who don't normally have access to civilian courts. They say wartime decisions should be left up to the president, who acts as commander in chief, not the courts.

The Justice Department had no comment on the briefs Wednesday and has until Nov. 13 to respond in court.

A Pentagon spokesman, Navy Cmdr. Jeffrey D. Gordon, defended the new law and said that terror suspects were being given their day in court.

"As a responsible democracy, we have an obligation to protect our citizens and those of our allies," Gordon said. "Holding unlawful enemy combatants captured during the war on terror is essential to preventing their return to the battlefield while collecting valuable intelligence in order to avert terror attacks like those seen on 9/11 and in cities around the world."