A divided judicial panel ruled this morning that about 400 foreign nationals who have been detained for as long as five years at a military prison in Guantanamo Bay, Cuba, do not have rights to challenge their indefinite imprisonment through the U.S. court system.

In a 2-1 decision{vbar}http://pacer.cadc.uscourts.gov/docs/common/opinions/200702/05-5062b.pdf, a panel of the U.S. Court of Appeals for the District of Columbia found that Congress's 2006 Military Commissions Act firmly blocked detainees from trying to appeal the president's decision to hold them without charges and without any promise of release.

Attorneys representing the detainees plan to appeal to the Supreme Court, and a group of Senate Democrats introduced legislation last week that would restore some of the detainees' rights.

Many detainees, viewed by the military as potential terrorism suspects or people with valuable information about terrorist plots, have been seeking through pro bono lawyers to challenge their imprisonment using a longstanding American legal right called the writ of habeas corpus.

The Supreme Court ruled last summer in one case involving a detainee, Salim Ahmed Hamdan of Yemen, that pending habeas cases could continue -- a decision{vbar}http://www.supremecourtus.gov/opinions/05pdf/05-184.pdf that undercut the Bush administration's original rules for trying detainees before military commissions. But four justices said the president could seek from Congress the authority they said he lacked.

At the urging of President Bush last fall, Congress passed The Military Commissions Act, stripping detainees at Guantanamo Bay of their right to try to bring their cases before federal judges.

In arguing the case decided by the appeals court today, attorneys for the detainees had said the Military Commissions Act should not apply to challenges already pending before the court.

But, given the new laws passed by Congress, "federal courts have no jurisdiction in these cases," Circuit Judge A. Raymond Randolph wrote for the panel.

"Everyone who has followed the interaction between Congress and the Supreme Court knows full well that one of the primary purposes of the [Military Commissions Act] was to overrule" the Supreme Court's decision to give detainees access to federal courts, Randolph wrote. "Everyone, that is, except the detainees. Their cases, they argue, are not covered."

Randolph wrote in the 25-page opinion that the arguments by the detainees' attorneys were "creative but not cogent."

"To accept them," he said, "would be to defy the will of Congress."

Randolph also cited precedent-setting decisions by the Supreme Court and U.S. Court of Appeals stating that the Constitution "does not confer rights on aliens without property or presence within the United States."

Although it is run by the U.S. Navy, the Guantanamo base is located in Cuba, which "has sovereignty over Guantanamo Bay," Randolph wrote. The United States occupies the base under an indefinite lease it signed with Cuba in 1903, he wrote.

Lawyers for the detainees said they had expected the panel to rule against them, but were glad to receive the ruling after a two-year wait so they could appeal it directly to the Supreme Court.

In a lengthy dissent to the ruling, Judge Judith W. Rogers wrote that the Military Commissions Act did not square with the Constitution or history, because it would suspend the writ of habeas corpus indefinitely, even when there was no war on U.S. soil.

"Suspension has been an exceedingly rare event in the history of the United States," Rogers wrote. "On only four occasions has Congress seen fit to suspend the writ. These examples follow a clear pattern: Each suspension has made specific reference to a state of 'Rebellion' or 'Invasion' and each suspension was limited to the duration of that necessity."

Rogers wrote that Congress exceeded its own powers by attempting "to revoke federal jurisdiction that the Supreme Court held to exist." The Military Commissions Act, she said, "therefore has no effect on the jurisdiction of the federal courts to consider these petitions and their related appeals."

A group of Senate Democrats introduced legislation last week that would strike down parts of the Military Commissions Act and restore habeas corpus rights to all detainees in U.S. custody.

The bill, titled the "Restoring the Constitution Act of 2007," would restrict the president's authority to interpret when certain human rights standards apply to detainees, and would limit the label "enemy combatant" to a person "who directly participates in hostilities in a zone of active combat against the United States" or who took part in the terrorist attacks of Sept. 11, 2001.

"I take a backseat to no one when it comes to protecting this country from terrorists," Sen. Christopher J. Dodd (D.-Conn.), one of the sponsors of the legislation, said in a statement last week. "But there is a right way to do this and a wrong way to do this. It's clear the people who perpetrated these horrendous crimes against our country and our people have no moral compass and deserve to be prosecuted to the full extent of the law. But in taking away their legal rights, the rights first codified in our country's Constitution, we're taking away our own moral compass, as well."

Sen. Lindsey O. Graham (R-S.C.), who helped write the Military Commissions Act, praised today's court decision. "The determination of enemy combatant status belongs with the military," he said in a statement. "Civilian judges are not trained to determine who presents a threat to our nation."

Staff writer Debbi Wilgoren contributed to this report.