As the scene unfolded on the floor, Rosengarten and other Senate aides watched from the gallery. Rosengarten turned to a colleague and said, “Now it’s our turn. We’ve got to go pass this thing in the Senate.”

When the Obama era began, John Kerry was looking for a new political identity. Like Lieberman, he had a strained relationship with the new President. Kerry had been scheduled to endorse Obama the day after Obama’s presumed victory in the New Hampshire primary. But Obama lost, and that night he nervously called Kerry and asked, “Are you still on board?” Kerry said he was. “Ninety-nine per cent of politicians would have walked away at that moment, because our odds of winning the primaries were quite low,” Dan Pfeiffer, now Obama’s communications director, told me in a 2008 interview. “It was a huge moment.” Kerry and his aides believed that, if Obama was the President, Kerry’s endorsement would give him the inside track in the competition for the job as Secretary of State. But Obama passed him over.

Kerry, as the chairman of the Foreign Relations Committee, could help steer the Administration’s foreign policy, but he wanted to play a big role in shaping Obama’s domestic agenda. In 2007, he had written a book about environmental activism, “This Moment on Earth,” and the issue was a rare one in which the junior senator from Massachusetts had a deeper interest than the senior senator, Ted Kennedy. For most of their quarter century together in the Senate, Kennedy was the legislator (the Americans with Disabilities Act, State Children’s Health Insurance Program, No Child Left Behind), and Kerry was the investigator (P.O.W.s in Vietnam, B.C.C.I., Iran-Contra). Now that could change. “This was Kerry’s opportunity to prove that he could be in a major, really historic piece of legislation,” Lieberman said.

At first, Kerry joined forces with Barbara Boxer, and spent months trying to find a Republican co-sponsor for her bill, which was almost a carbon copy of Waxman-Markey. In August, Rosengarten was eating lunch with Kerry’s climate-policy aide, Kathleen Frangione, at Sonoma, a Capitol Hill wine bar. Rosengarten said she had spent hours working on the nuclear legislation with Graham’s policy aide, Matthew Rimkunas, and she was shocked by something he had recently told her: Graham would have backed a climate-change bill that Lieberman had co-sponsored in 2007 if it had included the language supportive of nuclear power that they had just worked out. Kerry and Graham had to talk. Perhaps Kerry could split off from Boxer and try to work with Graham on a bipartisan bill.

Within days, Kerry and Graham were meeting in Kerry’s office to negotiate the language of a Times Op-Ed piece announcing their partnership. As they talked, Kerry suddenly found himself having to reassess his convictions on oil drilling, nuclear energy, and environmental regulations with someone he barely knew and whom he had reason not to like. In 2004, Graham had gratuitously told the Times that Kerry “has no charisma” and “doesn’t relate well to average people.” But the two men agreed that their eventual bill would have to help the nuclear industry and expand oil drilling. As they wrote the article, Graham introduced a third issue: revoking the E.P.A.’s authority to regulate greenhouse gases. Kerry was furious, but he eventually relented. The Op-Ed would include language signalling to insiders that E.P.A. authority would be curtailed: “Industry needs the certainty that comes with congressional action.”

The article ran on October 11th. The next day, Graham was holding a town-hall meeting in the gym of a high school in Greenville, South Carolina. His constituents were not happy. One man accused him of “making a pact with the Devil.” Another shouted, “No principled compromise!” One audience member asked, “Why do you think it’s necessary to get in bed with people like John Kerry?” Graham, dressed in a blue blazer and khakis, paced the floor, explaining that there were only forty Republicans in the Senate, which meant that he had to work with the sixty Democrats. A man in the bleachers shouted, “You’re a traitor, Mr. Graham! You’ve betrayed this nation and you’ve betrayed this state!”

Soon afterward, Graham called Lieberman. He was concerned that Kerry might drag him too far to the left, and he knew that Lieberman, a close friend with whom he had travelled during McCain’s Presidential campaign, could serve as a moderating force. Graham may not have remembered that Kerry and Lieberman had, according to a Senate aide, “a tense personal relationship.” (Lieberman and Kerry ran against each other for President in 2004. In 2006, Kerry endorsed and campaigned for Lieberman’s Democratic opponent in his Senate race.) “I’m happy to try and negotiate a bill with Kerry,” Graham told Lieberman. “But I really want you in the room.”

On October 28, 2009, Graham was eating dinner at the Capital Grille, an expense-account steakhouse on Pennsylvania Avenue, with Fred Krupp, the president of the Environmental Defense Fund, and Rick Davis, a Republican consultant who had managed McCain’s two Presidential campaigns. The E.D.F., virtually alone among green groups in trying to form bonds with Republicans, prides itself on being the most politically sophisticated environmental organization in Washington. Krupp, who has short gray hair and a Brooks Brothers look that announces his disdain for hemp-wearing environmental activists, had helped to educate McCain on climate change, and the two men became close. Now he wanted to do the same for Graham. He called Davis, who was an E.D.F. board member, and arranged the dinner.

Graham came to the issue strictly as a dealmaker. He saw the Democrats’ interest in capping carbon emissions as an opportunity to boost the nuclear industry and to expand oil drilling. But now Krupp explained the basics of global-warming science and policy: how carbon trading worked, how farmers could use offsets to earn an income from growing trees, and how different lobbyists would affect the debate. Krupp told Graham that the crucial feature of the policy was the hard cap on emissions. The House bill required American carbon emissions to be seventeen per cent below 2005 levels by 2020. As long as that number held, environmentalists would show flexibility on most other issues. The dinner lasted three hours. The next day, Kerry, Graham, and Lieberman held their first meeting as the triumvirate that became known to everyone following the debate as K.G.L.

Heckled at home, Graham began to enjoy a new life as a Beltway macher. “Every lobbyist working on the issue wanted time with him, because suddenly it became clear that he could be the central person in the process,” Krupp recalled. All sectors of the economy would be affected by putting a price on carbon, and Graham’s campaign account started to grow. In 2009, he raised nothing from the electric-utility PACs and just fourteen thousand four hundred and fifty dollars from all PACs. In the first quarter of 2010 alone, the utilities sent him forty-nine thousand dollars. Krupp introduced Graham to donors in New York connected to the E.D.F. On December 7th, Julian Robertson, an E.D.F. board member and a hedge-fund billionaire, hosted Graham at a small gathering in his Manhattan apartment. Some New York guests gave money directly to Graham’s campaign account. Others, at Krupp’s suggestion, donated to a new group called South Carolina Conservatives for Energy Independence, which ran ads praising Graham in his home state.

For years, Graham had lived in McCain’s shadow. But, as the rebellious politics of 2010 transformed McCain into a harsh partisan, Graham adopted McCain’s old identity as the Senate’s happy moderate. To Graham’s delight, on December 23rd Time posted an online article headlined “LINDSEY GRAHAM: NEW GOP MAVERICK IN THE SENATE.” The photograph showed Graham standing at a lectern with Lieberman and Kerry.

McCain, worried about his reëlection, had been throwing rocks from the sidelines as the cap-and-trade debate progressed. When Waxman-Markey passed, he Tweeted that it was a “1400 page monstrosity.” A month after K.G.L. was formed, McCain told Politico, “Their start has been horrendous. Obviously, they’re going nowhere.” After the Time piece appeared, he was enraged. Graham told colleagues that McCain had called him and yelled at him, incensed that he was stealing the maverick mantle. “After that Graham story came out, McCain completely stopped talking to me,” Jay Newton-Small, the author of the Time piece, said.

Other Republican colleagues taunted Graham. “Hey, Lindsey,” they would ask, “how many times have you talked to Rahm today?,” and the criticisms in South Carolina became more intense. But Graham gave every indication to Lieberman and Kerry that he could deal with the pressure. He wasn’t up for reëlection until 2014, and his conversations with them, and with Krupp, the White House, and the Manhattan environmentalists, seemed to be having an impact. At a climate-change conference in South Carolina on January 5, 2010, Graham started to sound a little like Al Gore. “I have come to conclude that greenhouse gases and carbon pollution” are “not a good thing,” Graham said. He insisted that nobody could convince him that “all the cars and trucks and plants that have been in existence since the Industrial Revolution, spewing out carbon day in and day out,” could be “a good thing for your children and the future of the planet.” Environmentalists swooned. “Graham was the most inspirational part of that triumvirate throughout the fall and winter,” Michael Brune, the executive director of the Sierra Club, said. “He was advocating for strong action on climate change from an ethical and a moral perspective.”

But, back in Washington, Graham warned Lieberman and Kerry that they needed to get as far as they could in negotiating the bill “before Fox News got wind of the fact that this was a serious process,” one of the people involved in the negotiations said. “He would say, ‘The second they focus on us, it’s gonna be all cap-and-tax all the time, and it’s gonna become just a disaster for me on the airwaves. We have to move this along as quickly as possible.’ ”

In early December of 2009, Lieberman’s office approached Jay Heimbach, the White House official in charge of monitoring the Senate climate debate. For Obama, health care had become the legislation that stuck to the wall. As a consequence of the long debate over that issue, climate change became, according to a senior White House official, Obama’s “stepchild.” Carol Browner had just three aides working directly for her. “Hey, change the entire economy, and here are three staffers to do it!” a former Lieberman adviser noted bitterly. “It’s a bit of a joke.” Heimbach attended meetings with the K.G.L. staffers but almost never expressed a policy preference or revealed White House thinking. “It’s a drum circle,” one Senate aide lamented. “They come by, ‘How are you feeling? Where do you think the votes are? What do you think we should do?’ It’s never ‘Here’s the plan, here’s what we’re doing.’ ”

Lieberman’s office proposed to Heimbach that the first element of the bill to negotiate was the language about oil drilling. Lieberman and Graham believed it would send a clear message to Republicans and moderate Democrats that there were parts of the bill they would support. Heimbach favored doing anything to attract Republicans, and, though he wouldn’t take any specific actions, he generally supported the strategy.

Graham asked Senator Lisa Murkowski, of Alaska, to write the drilling language. Murkowski was up for reëlection and would soon be facing a primary against a Sarah Palin-backed Tea Party candidate. Her price for considering a climate-change bill with John Kerry’s name attached to it was high: she handed over a set of ideas for drastically expanding drilling, which included a provision to open the Arctic National Wildlife Refuge to oil companies. Democrats had spent decades protecting ANWR, and even Graham didn’t support drilling there. But he passed the Murkowski language on to his colleagues to see how they would react.

The K.G.L. coalition had two theories about how to win over Republicans and moderate Democrats. One was to negotiate directly with them and offer them something specific for their support. After a year of that method, the coalition had one Republican, and its next most likely target wanted to drill in ANWR. Other Republicans were slipping away. Shortly before Thanksgiving, George LeMieux, of Florida, approached Graham in the Senate gym and expressed interest in joining K.G.L. “Let me teach you something about this town,” Graham told him. “You can’t come that easy.” Graham was trying to give the new senator some advice, according to aides involved with the negotiations: LeMieux would be foolish to join the effort without extracting something for himself.

But LeMieux didn’t have the chance to try that, as he soon became another casualty of Republican primary politics. He had been appointed by the Florida governor, Charlie Crist, who was then running in a tight Republican primary for the seat against another Tea Party favorite, Marco Rubio. LeMieux couldn’t do anything that would complicate Crist’s life. In a private meeting with the three senators in December, he told them that he couldn’t publicly associate himself with the bill. But, according to someone who was present, he added, “My heart’s with you.”

As for Olympia Snowe, the moderate Republican from Maine, who was known for stringing Democrats along for months with vague promises of joining their legislative efforts, she seemed to have a new demand every time Kerry, Graham, and Lieberman sat down with her. She also made it clear that granting her wishes—everything from exempting home heating oil from greenhouse-gas regulations and permanently protecting Georges Bank, a Maine fishery, from drilling—would not guarantee her support. She had used similar tactics to win concessions in Obama’s health-care bill, which she eventually voted against. “She would always say that she was interested in working on it,” a person involved in the negotiations said, “but she would never say she was with us.”

Another prospect was Susan Collins, the other Republican from Maine. She was the co-sponsor of a separate climate bill, with Maria Cantwell, a Democrat from Washington. Their bill, known as “cap-and-dividend”—the government would cap carbon emissions and use revenue from polluters to compensate taxpayers for energy-rate hikes—gained some environmental support. Kerry, Graham, and Lieberman believed that the bill was unworkable and was stealing valuable attention from their effort. They spent months trying to figure out how to kill it and win over Collins. Eventually, Graham and Lieberman’s offices devised a ruse: they would adopt a crucial part of the Cantwell-Collins bill on market regulation in the official bill. Then they would quietly swap it out as the legislation made its way to the Senate floor. Collins, however, never budged.