The move was a reversal for the president, who had resisted such legislation.
Mr. Bush, speaking during a meeting with McCain at the White House, said the agreement will "make it clear to the world that this government does not torture."
Additional language to the amendment obtained by CBS News chief White House correspondent John Roberts sought to provide a defense to protect U.S. officials authorized to interrogate persons believed to be a threat and thought to be legal. The amendment states: "It shall be a defense that such officer, employee, member of the Armed Forces or other agent did not know that the practices were unlawful and a person of ordinary sense and understanding would not know the practices were unlawful." Click here to read the full text.
CBS News correspondent Bob Fuss reports the White House bitterly fought the measure for months, threatening a presidential veto of any bill containing the torture ban and sending Vice President Cheney to personally lobby to exempt the CIA.
But congressional sentiment was overwhelmingly in favor of the ban, and McCain, a former Navy pilot who was held and tortured for five and a half years in Vietnam, adopted the issue.
Under the deal, CIA interrogators would be given the same legal rights as currently guaranteed members of the military who are accused of breaking interrogation guidelines. Those rules say the accused can defend themselves by arguing it was reasonable for them to believe they were obeying a legal order.
"We've sent a message to the world that the United States is not like the terrorists," McCain said, sitting next to the president in the Oval Office.
The Republican maverick and the administration have been negotiating for weeks in search of a compromise, but it became increasingly clear that he, not the administration, had the votes in Congress.
Mr. Bush called McCain "a good man who's honored the values of America."
"We have worked very closely with the senator and others to achieve that objective as well as to provide protections for those who are the front line of fighting the terrorists," Mr. Bush said.
After the deal was announced, Rep. Duncan Hunter, R-Calif., chairman of the House Armed Services Committee, said he would block completion of one of the two defense bills that includes the ban unless he got White House assurances that "the same high level of effective intelligence gathering" would be achieved if the agreement became law.
But Hunter's spokesman said the chairman spoke with intelligence director John Negroponte and "received the assurances he needs" and would move the bill forward.
As passed by the Senate and endorsed by the House, McCain's amendment would prohibit "cruel, inhuman or degrading treatment or punishment" of anyone in U.S. government custody, regardless of where they are held. It also would require that service members follow procedures in the Army Field Manual during interrogations of prisoners in Defense Department facilities.
In discussions with the White House, that language was altered to bring it into conformity with the Uniform Code of Military Justice. That says that anyone accused of violating interrogation rules can defend themselves if a "reasonable" person could have concluded they were following a lawful order.