The US senate has voted to ban the CIA from using waterboarding, the interrogation method that simulates drowning, and other harsh questioning techniques.
The senate approved the bill that restricts the CIA to the 19 interrogation methods specified by the US army, despite a warning from the US president that he would use his veto.
The bill, which the House of Representatives approved in December, was passed 51-45 by the senate.
Michael Hayden, the CIA's director, has said waterboarding may not be legal under current law.
But George Bush, the US president, has threatened to veto any bill that limits CIA interrogation techniques.
Tony Fratto, a White House spokesman, said: "For a number of reasons, the president's advisers would recommend a veto of this bill. Parts of this bill are inconsistent with the effective conduct of intelligence gathering."
John McCain, the leading Republican presidential candidate and an author of previous anti-torture legislation, voted against the overall bill.
"I made it very clear that I think that waterboarding is torture and illegal, but I will not restrict the CIA to only the army field manual," McCain said on Wednesday.
Last week, Hayden admitted waterboarding had been used on three al-Qaeda suspects, including Khalid Sheikh Mohammed, who was charged this week in relation to the September 11, 2001 attacks in New York.
Hayden told congress last week that waterboarding may no longer be legal, but the White House has refused to rule out using it again.
Michael Mukasey, the US attorney-general, has refused to rule on whether waterboarding is legal, saying he will do so only if US intelligence services ask to use it again.
Waterboarding has been widely condemned by human rights groups and other countries as a form of torture.