The strategy was a desperate and ultimately unsuccessful gambit by Republican leaders, who had run out of options after failing to persuade their majority to pass legislation to repeal the Affordable Care Act and replace it with a promised new healthcare plan.
Instead, they said their so-called skinny repeal bill would only be used as a vehicle to develop a comprehensive package later in consultation with House Republicans, who passed a more sweeping bill in May.
The tally was delayed for several minutes just before it was set to take place by some dramatic last-minute lobbying of McCain by Vice President Mike Pence and others, but they were unable to sway the lawmaker.
McCain, who was recently diagnosed with brain cancer, had provided the critical last vote needed to begin debate on the measure earlier this week when he flew out from Arizona, where he has been recuperating from surgery to remove a blood clot.
The failure sends Senate GOP leaders back to square one in their bid to roll back the healthcare law.
“This is clearly a disappointing moment,” said Senate Majority Leader Mitch McConnell (R-Ky.), challenging Democrats to come up with a better solution to fixing problems with the current law. “It is time to move on.”
Sen. Charles E. Schumer of New York, the Democratic leader, said he looked forward to taking a bipartisan approach to healthcare reform. "It’s time to turn the page," he said. "We are not celebrating. We are relieved."
Shortly after the vote, President Trump responded on Twitter: “3 Republicans and 48 Democrats let the American people down. As I said from the beginning, let ObamaCare implode, then deal. Watch!”
The bill would have left much of the 2010 law in place and eliminated just a few of its provisions, including its insurance mandates.
According to the nonpartisan Congressional Budget Office, the bill would would have left 16 million more people uninsured over the next decade and increased insurance premiums by an average of 20% annually over the next decade.
The eight-page Health Care Freedom Act, as the plan is formally known, eliminated the requirement that Americans have health insurance and suspended a requirement that large employers provide insurance to their employees.
It delayed for three years a tax on medical device makers.
Additionally, the legislation made it easier for states to avoid some requirements in the current law and allowed consumers to sock more money away in Health Savings Accounts to pay for insurance premiums.
It also restricted funding to Planned Parenthood by prohibiting federal funding to clinics that provide abortion services, even for non-abortion-related services such as cancer screenings.
Most GOP senators panned the bill. Sen. Lindsey Graham of South Carolina had called the plan a “fraud,” “disaster” and “the dumbest thing in history.” Senators said they feared the House might simply pass the skinny bill and send it to President Trump to be signed into law.
He and other senators initially were not satisfied by assurances from House Speaker Paul D. Ryan (R-Wis.), who offered a somewhat qualified promise that the House would not do that.
In the end, however, Graham voted for the measure.
Collins said the promise of a conference with the House was not enough for her vote.
“That’s not a great comfort to me, because I believe a conference bill would include the kind of deep cuts to Medicaid that would be very problematic for the people I represented, for rural healthcare providers who are barely hanging on as it is,” Collins said.
Staff writer Noam N. Levey contributed to this report.
11:35 p.m.: This report has been updated to include President Trump’s reaction on Twitter.
The original version of this article was posted at 10:35 p.m.