The White House and rebel Republican lawmakers ended their sharp division over the treatment of terror suspects, agreeing on Thursday on how they should be questioned and tried.
US President George W. Bush, reacting to the deal, said the agreement "clears the way to do what the American people expect us to do: to capture terrorists, to detain terrorists, to question terrorists and then to try them."
Bush, speaking on a day-long trip to Florida, said he was happy that the agreement "preserves the single most potent tool we have in protecting America and foiling terrorist attacks, and that is the CIA program to question the world's most dangerous terrorists and to get their secrets."
The Bush administration had faced a rebellion from several prominent Republican senators, led by John McCain and Armed Services Committee Chairman John Warner, who had openly refused to support wording put forward by the White House on the issue.
The agreement now goes for debate in Congress for formal adoption.
McCain, a former navy pilot who was captured during the Vietnam war, held prisoner and tortured, said the accord had produced a successful outcome for all sides, ensuring the right balance between national security and civil liberties.
Graham said the agreement will allow US officials to bring charges against terror suspects and still protect classified information.
"But we're going to do it in a way that won't come back to haunt us if our troops fall into enemy hands in the next war, which will surely be forthcoming unless humanity changes," he said.
The Democratic opposition reacted cautiously to the deal.
"Democrats are united behind the need to work on a bipartisan basis to bring terrorists to justice, and to do it in a manner consistent with our laws, our values and our national security," Senate Minority Leader Harry Reid said in a statement.
"Hopefully, today's press conference means that President Bush and the congressional Republican leadership have changed course and listened to numerous national security experts," Reid said.
"Five years after 9/11, it is time to make the tough and smart decisions to give the American people the real security they deserve," he said.
US national security adviser Stephen Hadley, one of the lead White House negotiators, said the sides were hammering out the final details "on a way to detain, question and bring to justice terrorists."
Hadley said a list of interrogation techniques that would be permitted under the deal would not be publicly divulged.
But he said that "torture, cruel or inhuman treatment, performing biological experiments, obviously murder, mutilation or maiming, intentionally causing serious bodily injury, rape, sexual assault or abuse, taking hostages" would be prohibited.
The two sides still had to work out details of how detainees could be tried by special military commissions, including to what degree defendants would have access to evidence presented by prosecutors, Hadley said.
Military prosecutors might provide a summary of classified information for a defendant, with sensitive classified details left out, he said. But in no case would an accused terrorist have the right to demand access to classified information, even if it was part of the case against him, Hadley said.
The deal would also permit some coerced evidence in trials of detainees, if the evidence was deemed reliable by the presiding judge and not extracted through torture, he said.