Rarely has one senator held as much sway over an issue as John McCain did this week.

A seven-year quest to undo the Affordable Care Act collapsed — at least for now — as McCain and Sens. Susan Collins (Maine) and Lisa Murkowski (Alaska) ended GOP attempts to rewrite the health-care law. Collins and Murkowski had signaled their concerns for weeks, but it was McCain who provided the drama. Seemingly aware of his place in history and his total control over the political moment, the senator from Arizona stood against his party again with the hope of returning the U.S. Senate to past norms.

Not since Sen. Bob Kerrey (D-Neb.) publicly toiled over whether to support President Bill Clinton’s 1993 budget agreement had one senator held Washington in such suspense. But unlike Kerrey, who salvaged Clinton’s young presidency by voting for a spending plan that he didn’t entirely like, McCain defied President Trump’s attempts to revamp the health-care system and stared down Vice President Pence, who made a direct, last-ditch plea to the senator early Friday morning.

“I encourage my colleagues on both sides of the aisle to trust each other, stop the political gamesmanship and put the health-care needs of the American people first,” McCain said Friday. “We can do this.”

[The night John McCain killed the GOP’s health-care fight]

Sen. John McCain (R-Ariz.) speaks to reporters Thursday on Capitol Hill. (Cliff Owen/AP)

The week began with news that McCain would return to Washington just days after announcing that he had been diagnosed with glioblastoma, a particularly aggressive brain tumor. Bruised over his left eye and appearing pale, McCain jetted back to Capitol Hill on Tuesday in the midst of a vote to determine whether health-care legislation would survive. He walked into the Senate chamber to a standing ovation and voted with GOP senators to formally launch debate on the bill.

But afterward, McCain stood to speak as all of his colleagues watched, a rarity in the modern Senate. He then tore into Senate Majority Leader Mitch McConnell (R-Ky.) and the fractured nature of the Senate.

“We’ve been spinning our wheels on too many important issues because we keep trying to find a way to win without help from across the aisle,” McCain said. “We’re getting nothing done, my friends. We’re getting nothing done.”

McCain felt that his Tuesday speech set out a marker, a clear marker, for how he would decide his final vote, demanding a good, clean amendment process with a chance to change the bill for the better.

In his estimation, by Thursday night, the process and the product had grown significantly worse than the bill he had vowed to oppose just Tuesday afternoon.

The idea of voting for a terrible bill that everyone acknowledged they didn’t want to become law was anathema to everything he had stood for as a senator — and went against every principle he had laid out Tuesday.

As they began Thursday morning, GOP leaders believed that they could count on McCain’s vote to approve the “skinny repeal,” which would have repealed the ACA’s individual mandate and rolled back a tax on medical devices. But by lunchtime, McCain popped into the front rooms of McConnell’s office suites on the second floor of the Capitol to deliver a new message to Sen. John Cornyn (R-Tex.), the majority whip in charge of counting votes.

McCain warned Cornyn: Don’t count me as a yes.

He had switched his position, at least in the minds of McConnell’s leadership team, according to senior GOP aides.

Throughout the day, McConnell’s leadership team heard back and forth about the 80-year-old’s plans, one minute believing he would vote yes, the next hour hearing he was against the plan.

McCain’s best friend in the Senate, Lindsey O. Graham (R-S.C.), convened a news conference intended to get assurances that the legislation the Senate was considering would not be approved by the House and become law. Though Graham decided to support the plan as the only way to keep repeal negotiations alive, he went so far in thrashing the latest McConnell move — it was “a disaster . . . a fraud . . . a pig in a poke” — that McCain dug in even further against it.

At one point, according to GOP aides, McCain and Sen. Jeff Flake (R-Ariz.) huddled in the Republican cloakroom just off the Senate floor, putting their state’s governor, Republican Doug Ducey, on speakerphone to discuss what concerns he had with the skinny legislation. But with the proposed cuts to the ACA’s Medicaid expansion no longer on the table, Ducey did not raise much of an objection; Flake was fine with voting for the bill.

Meanwhile, Democrats had been running their own full-court press to win over McCain, and not just inside the Senate.

According to a Senate Democrat, McCain heard from two longtime friends pleading with him to oppose McConnell: Joseph I. Lieberman and Joe Biden.

The former senator from Connecticut was long one of McCain’s best friends, forming the heralded “Three Amigos” along with Graham. Despite his more conservative leanings on national security, Lieberman remained loyal enough to Democrats that in 2009 and 2010 he supported the ACA and relayed that continued support to McCain.

Biden, the former vice president who often clashed in a collegial way with McCain on foreign policy matters, had a more emotional discussion with McCain. The Arizonan’s brain cancer is the same diagnosis that Biden’s son, Beau, received in 2013; he died two years later.

Those conversations set in motion the most dramatic night in modern Senate history. Just ask the senators who were there. The decisions of Collins, McCain and Murkowski to buck their party put the Senate on the verge of protracted bipartisan talks that McCain might not witness because he is scheduled Monday to begin chemotherapy treatment for his cancer.

By Thursday night, rumors were swirling about McCain’s intentions. Reporters spotted him around 11 p.m.

“Have you decided how you’ll vote?” they asked.

“Yes,” McCain replied.

“How?”

“Wait for the show,” he said.

McCain headed for his stage — the Senate floor — around midnight, emerging from his office in the Russell Senate Office Building for the subway ride to the Capitol.

When he arrived, he had a brief conversation with Senate Minority Leader Charles E. Schumer (D-N.Y.), an exchange that left the New Yorker smiling.

“I knew it when he walked on the floor,” Schumer later recounted, explaining that McCain had already called to share his plans.

But few, if any, of his Republican colleagues realized what was about to transpire.

Two votes were called just after midnight. The first was on a Democratic proposal to refer the “skinny repeal” bill back to a committee. It failed. The second vote was to pass the “skinny repeal.”

With Collins and Murkowski already poised to vote no, Republicans could not afford to lose McCain. Pence was at the Capitol prepared to break a tie, but instead focused on winning McCain’s support.

McCain was seated with Graham, and when Murkowski walked over to join the conversation, McCain winked and gave her a thumbs down — signaling his intentions. Collins eventually joined the group. In the well of the chamber stood McConnell, Cornyn, Flake and Pence. They eventually dispatched Flake to talk to McCain again.

He obliged, walked over to McCain and asked Graham to move over one seat. But McCain didn’t initially acknowledge Flake, focusing instead on Collins and Murkowski.

That left Flake, one of the more earnest members of the Senate, leaning into the conversation uncomfortably with a pained look on his face, as if he had to tell his father that he had run over the family dog with his car.

Seeing that Flake was not making progress, Pence walked over at 12:44 a.m. McCain smiled, pointed at Collins and Murkowski, said something about “marching orders,” and stood up.

“Mr. Vice President,” McCain said, greeting Pence. For the next 21 minutes, Pence cajoled the trio. Twice, a Pence aide came to whisper in the vice president’s ear — it was the White House calling. Pence finally left to take a call, but later returned to speak with McCain.

By then, other senators realized what was happening.

“You could see the body language in the entire chamber change in two hours,” Sen. David Perdue (R-Ga.) recalled. “One side was kind of ebullient, moving around and talking and the other side was subdued, and all of a sudden it began to change. There was an instinctive reaction that maybe this thing wasn’t going to pass. Nobody knew for sure.”

“It was pretty somber,” added Sen. Amy Klobuchar (D-Minn.).

At 1:10 a.m., McCain crossed the Senate Chamber to talk to Schumer, Klobuchar and other Democrats, including Sens. Richard J. Durbin (Ill.), Dianne Feinstein (Calif.) and Elizabeth Warren (Mass.). As he approached, McCain told them he worried that reporters watching from the gallery above could read his lips. When he realized that the press was indeed watching, he looked up at the ceiling and shouted, “No!” as senators and reporters laughed. Democrats beamed when McCain shared his news. Feinstein gave him a hug.

Walking back to the Republican side of the room, McCain was stopped by Sen. Orrin G. Hatch (R-Utah), who also offered a hug.

“I love John McCain. He’s one of the great heroes of this country,” Hatch explained later. “Whether we agree or not, I still love the guy.”

The vote on “skinny repeal” began at 1:24 a.m., but McCain was out in the lobby conferring again with Pence. In his absence, Collins and Murkowski cast their “no” votes along with the 48 members of the Democratic caucus.

McCain returned at 1:29 a.m. without Pence, approached the Senate clerk and gave a thumbs down — the third “no” vote.

Several people gasped. Others applauded.

McCain headed for his seat as Cornyn and Sens. John Thune (R-S.D.) and Bill Cassidy (R-La.) stood grim-faced and despondent. Cassidy rubbed his face several times with his hands. Thune’s face contorted. The color in Cornyn’s face drained.

“Certainly, Senator McCain knows how to improve the drama,” Cassidy recalled later.

The vote concluded, and the results were announced — the bill was defeated, 51 to 49. Just days before, McCain had fired his warning shot in the floor speech that criticized the rushed, secretive process. Early Friday morning, McCain, Collins and Murkowski delivered the fatal blow.

McConnell, humiliated by the results, stood to address his colleagues. The color of his face matched the pink in his necktie.

“This is clearly a disappointing moment,” he said.

Sean Sullivan contributed to this report.