Congressional negotiators worked out the final details of a bill that bans torture of detainees in US custody, but also allows evidence obtained by coercion to be used against prisoners at Guantanamo Bay.
Human rights advocates said they scored a big win when President George W Bush reluctantly accepted Senator John McCain's amendment to require humane treatment of detainees.
But they said that would be partly undermined by another measure that limits access to federal courts for the roughly 500 inmates at Guantanamo Bay and allow some evidence obtained by coercion to be used against them.
The House of Representatives was expected to vote today on the bill, with the Senate to follow within a few days as Congress rushes to complete its business for the year.
The defense policy bill became a battleground on prisoner treatment in the wake of scandals over the sexual and physical abuse of detainees by US soldiers at Abu Ghraib prison in Iraq, harsh interrogations at US facilities at Guantanamo, and reports the CIA has run secret prisons abroad to hold terrorism suspects.
Most attention was on the amendment requiring humane treatment pushed by Mr McCain, who was tortured as a war prisoner in Vietnam. After he got veto-proof backing for his amendment in both the House and Senate, Mr Bush agreed to the measure that would put into law a ban on torture and set standards for interrogations.
Earlier, Mr Bush had said the amendment could hamper intelligence gathering in the US war on terrorism.