The US Senate passed controversial new guidelines on detaining and prosecuting "war on terror" suspects, over the objections of opponents who said the measure seriously curtails detainees' rights.
The vote was 65 to 34.
The Senate action, a day after its approval by the House of Representatives, came after US President George W Bush personally appealed to lawmakers on Capitol Hill for the swift passage of the legislation.
Senator Majority Leader Bill Frist earlier on Thursday said Bush would likely sign the measure early next week.
The legislation had become a major battleground in the national debate, pitting measures to safeguard the country from terrorism against the need to protect civil liberties, just weeks ahead of November legislative elections.
Republican Senator John McCain said the bill was a compromise between competing interests, but one which, crucially, maintained the US commitment to adhere to the Geneva Conventions governing the treatment of foreign combatants.
"The United States should champion the Geneva Conventions, not look for ways to get around them lest we invite others to do the same," McCain said minutes before the vote on Thursday.
"America has more personnel deployed in more places than any other country in the world, and this unparalleled exposure only serves to further demonstrates the critical importance of our fulfilling the letter and the spirit of our international obligations," he said.