Just days after John McCain was diagnosed with brain cancer, he flew in to Washington, D.C., from Arizona on the pretense that he would help save Senate Majority Leader Mitch McConnell’s health care bill. In the end, he helped derail it.

Just hours after Senate leadership had unveiled its “better health care bill,” the measure failed 51-49, a stunning defeat for McConnell, who had been frantically trying to whip up the necessary votes for days.

Since this was passing under the budget’s reconciliation process, Senate leadership only needed 50 votes. With 52 Senators in the conference, that means they could only afford two defections. They ended up with three: Sens. Susan Collins of Maine, Lisa Murkowski of Alaska and McCain.

The final Republican bill would have repealed the employer and individual mandates under Obamacare, causing premiums to rise 20% between 2018 and 2026 and leaving 43 million more people without insurance in 2026, according to an estimate released Thursday from the Congressional Budget Office.

McCain had objected to the process, arguing that hearings should have been held on the bill and Democrats given more say. Collins was consistently opposed to the bill, and adamantly against any provision that prohibited Medicaid funds from going to Planned Parenthood, which the final bill did.

Murkowski had also repeatedly voiced objections about the process, and had repeatedly stressed her opposition to the Planned Parenthood provision. Murkowski and Collins, both of whom were left out of McConnell’s working group to draft the bill, were the only two Republican Senators to vote against proceeding to debate earlier in the week.

Murkowski’s decision to vote against the bill came after Trump criticized her opposition to proceed with debate on Twitter, and after the Trump Administration’s Interior Secretary reportedly threatened funding for Alaska.

McCain seemed to relish his return to maverick and breaking with his party. He kept the decision close to the chest until he cast his vote, telling reporters who asked as he headed to the chamber after the latest bill had been revealed to “watch the show.”

But as Senators continued to give remarks on the floor, reporters noticed something: Schumer had smiled after he spoke with the Arizona Senator. And after Schumer gave an impassioned plea about the need for the chamber to do away and start over on reforms in a bipartisan fashion, McCain applauded—the only Republican Senator to do so.

As the Senate voted on a motion to send the bill back to the committee—which failed, as expected—McCain huddled with various Senators.

Then, after everyone had voted on the motion, everything stalled. The vote began at 12:21 AM. Every Senator had finished voting within the half hour, but instead of turning to the so-called “skinny repeal” bill, leaders held the vote open. Attention turned to McCain as party leadership presumably tried to woo him.

Pence huddled alone with McCain. McCain, Collins, Murkowski and Jeff Flake were talking among themselves. Something was awry in McConnell’s plan.

Democratic Sen. Claire McCaskill was the first in the chamber to break the silence and give some indication what was going on.

“There is now a glimmer of hope that we stop this and hopefully start over in a bipartisan way to stabilize ins markets and bring down costs,” the Missouri Senator wrote on Twitter at 1:07 A.M.

At 1:25 A.M. the chamber began voting on McConnell’s bill. Fifteen minutes later the vote had closed.

“This is clearly a disappointing moment,” said McConnell immediately afterwards. “I regret that our efforts were simply not enough this time.”

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Alana Abramson at Alana.Abramson@time.com and Jack Brewster at jack.brewster@time.com.