US Senators have backed the right of Guantanamo terror suspects to appeal against their verdicts if convicted, a move President George W Bush may block.
About 500 detainees are thought to remain in Guantanamo
But the resolution, which was supported by 84 votes to 14, also denies suspects being held at the US jail in Cuba the right to challenge their detention.
A call by Senator John McCain to ban torture and cruel treatment was included in the resolution.
Bush officials are thought to object strongly to the McCain amendment.
Policy on how to deal with terror suspects is an area which until now has been jealously guarded by the Bush administration.
Democrats and Republicans alike voted on the resolution to allow appeals once inmates have been tried and sentenced.
However, while they are awaiting trial, prisoners will not be able to challenge their detention in federal courts.
The controversy over the US treatment of detainees continues to do untold damage to America's image abroad, writes the BBC's world affairs correspondent, Nick Childs.
For the critics, it has been a massive own-goal by the Bush administration.
And even those in Congress who sympathise with the administration's views on detainee rights are impatient to see the arguments put to rest.
Some in the administration are said to support the resolution if it holds out the prospect of reducing the number of legal challenges.
But it is not clear if such a compromise will satisfy the administration as a whole, or its critics.
Senator McCain, a Republican, uses catch-all language in his amendment prohibiting the use of torture and cruel, inhuman, or degrading treatment by any US government agency.
Top officials in the White House - and especially US Vice-President Dick Cheney - have tried to block this.
The hope of some in Congress is that, by presenting a comprehensive package, they can reduce White House opposition but also put the issue to rest as a whole once and for all.
The risk is that it will simply aggravate what remains very much an open wound, our correspondent adds.