Opponents of the measure denounced the Senate vote as a grave step backward in the nation's treatment of detainees in the global war on terror. "This is not a time to back away from the principles that this country was founded on," Mr. Bingaman said during floor debate.

Senator Arlen Specter of Pennsylvania, chairman of the Judiciary Committee and one of four Republicans to vote against the measure, said the Senate was unduly rushing into a major legal shift without enough debate. "I believe the habeas corpus provision needs to be maintained," Mr. Specter said.

A three-judge panel trying to resolve the extent of Guantánamo prisoners' rights to challenge detentions sharply questioned an administration lawyer in September when he argued that detainees had no right to be heard in federal appeals courts.

The panel of the District of Columbia Circuit is trying to apply a 2004 Supreme Court ruling to two subsequent, conflicting decisions by lower courts, one appealed by the prisoners and the other by the administration.

In its June 28, 2004, decision in Rasul v. Bush, the Supreme Court ruled 6 to 3 that the Guantánamo base was not outside the jurisdiction of American law as administration lawyers had argued and that the habeas corpus statute allowing prisoners to challenge their detentions was applicable.

Under Mr. Graham's measure, Guantánamo prisoners would be able to challenge only the narrow question of whether the government followed procedures established by the defense secretary at the time the military determined their status as enemy combatants, which is subject to an annual review. The District of Columbia Circuit would retain the right to rule on that, but not on other aspects of a prisoner's case.

Detainees would not be able to challenge the underlying rationale for their detention. "If it stands, it means detainees at Guantánamo Bay would have no access to any federal court for anything other than very simple procedural complaints dealing with annual status review," said Christopher E. Anders, a legislative counsel for the American Civil Liberties Union. "Otherwise, the federal courts' door is shut."