Two sources close to negotiations between the two sides tell NEWSWEEK that key elements of the deal were first floated by the senators as long as a week ago. (The sources familiar with the negotiations asked for anonymity because of the continuing political sensitivity of the issue.) At one point several days ago, says one of the sources, it looked like the two sides were getting close to an agreement. But the White House then backed away from the negotiations and took a hard line for several days—for reasons that remain unclear.

But by Thursday, the administration essentially agreed to the McCain-Graham-Warner proposal that it had previously rejected. What caused this change of heart? The sources say it was clear that the GOP renegades’ position was supported by at least 51 senators. By the same token, an important element in the compromise, the sources say, was the recognition by Graham, McCain and Warner all along that neither they nor a majority of their Senate colleagues really wanted to put the CIA interrogation program completely out of business.

During a five-hour closed-door meeting Thursday on Capitol Hill, the rebel senators and their aides hammered out an agreement with White House representatives. Initially, administration officials, including President Bush, had indicated in public remarks that they believed the CIA interrogation and detention program could only go forward if Congress passed legislation clarifying an allegedly “vague” clause in the 60-year-old Geneva Conventions, an international treaty governing the treatment of prisoners. But Senators McCain, Graham and Warner maintained that international law does not permit the United States to reinterpret treaties ratified by Congress years after they went into force. If Congress did this, the senators argued, then foreign countries could reinterpret the Geneva Conventions in the event they capture American soldiers overseas and want to interrogate them using harsh methods.

The new agreement does not qualify or redefine the “vague” Geneva language on “outrages” or “humiliation and degradation”; the administration had sought such clarifications in order to give CIA interrogators legal protection against prosecution or civil lawsuits under the Geneva’s terms as a result of harsh interrogation techniques. Instead, the agreement between the senators and the White House alters a section of the U.S. criminal code dealing with war crimes to more tightly define what kind of interrogation methods by American officials would be legal.

During the course of working out the agreement, the administration and the GOP senators reached an understanding—not explicitly laid out in the formal legal language agreed to by both sides—that the CIA would still be allowed, if it was deemed necessary, to use harsher methods than are employed by the U.S. military to question high-level terrorist detainees. However, the agreement also contains legalistic language that the sources close to the negotiations say effectively bans one of the most controversial interrogation techniques that the CIA allegedly used on at least a handful of high-level terrorists it detained in the wake of the 9/11 attacks, a practice known as “waterboarding.”

As described in various media accounts, “waterboarding” involves strapping an interrogation subject to a board and then pouring water over his face until he begins to believe he is drowning. The CIA is believed to have used the tactic on at least one high-level Al Qaeda detainee—the 9/11 mastermind Khalid Shaikh Mohammed—and perhaps one or two others.

However, McCain’s group believed that waterboarding was clearly illegal under the Geneva Conventions and probably U.S. anti-torture legislation, too. More than a week ago, the administration had signaled via its negotiators that it intended to stop the CIA from waterboarding, though it still wanted agency interrogators to be able, in extreme cases, to use other harsh techniques not available to U.S. military interrogators. (Though these remain classified, human-rights lawyers have claimed they include various forms of slapping and exposing interrogation subjects to stressful exercise and extreme temperatures).

The agreement reached by the White House with the three senators contains coded language which a source close to the negotiations say is intended to outlaw waterboarding. The language of the agreement, which for the moment is being kept confidential, alters the U.S. criminal code to ban “serious and non-transitory mental harm (which need not be prolonged),” according to a draft of the wording made available to NEWSWEEK. This, according to the source, was clearly meant by the agreement’s authors to include waterboarding, though the agreement does not use that word.

In a potentially controversial twist, the agreement also says that the proposed new language banning “mental harm” also will only begin to apply after Congress passes the overall legislation containing the new language. A source close to the negotiations said human-rights activists are likely to criticize this detail as an attempt to declare legal, after the fact, any waterboarding episodes which might have occurred before the legislation was passed. However, the source said that U.S. interrogators who might have engaged in such practices could cite secret government orders or legal opinions as legal defenses should they ever face criminal or civil charges.

A source familiar with Thursday’s marathon negotiating session which led up to the new agreement said that Senators Graham, Warner and McCain all personally participated in the talks. The administration’s chief negotiators were national-security adviser Stephen Hadley and Steven Bradbury, a senior Justice Department official. According to the source, the talks took place in a Senate office suite reserved for the staff of Vice President Dick Cheney. The source noted, however, that neither Cheney nor his aides, usually amongst the hardest of administration hard-liners on antiterrorism practices and legislation, were either present or visible during the critical final negotiating round.