Senator John McCain of Arizona, who just this week returned to the Senate after receiving a diagnosis of brain cancer, cast the decisive vote to defeat the proposal, joining two other Republicans, Susan Collins of Maine and Lisa Murkowski of Alaska, in opposing it.
The 49-to-51 vote was also a humiliating setback for the Senate majority leader, Mitch McConnell of Kentucky, who has nurtured his reputation as a master tactician and spent the last three months trying to devise a repeal bill that could win support from members of his caucus.
As the clock ticked toward the final vote, which took place around 1:30 a.m., suspense built on the Senate floor. Mr. McCain was engaged in a lengthy, animated conversation with Vice President Mike Pence, who had come to the Capitol prepared to cast the tiebreaking vote for the measure. A few minutes later, when Mr. McCain ambled over to the Democratic side of the chamber, he was embraced by Senator Dianne Feinstein, Democrat of California. A little later Senator Amy Klobuchar, Democrat of Minnesota, put her arm around Mr. McCain.
The truncated Republican plan that ultimately fell was far less than what Republicans once envisioned. Republican leaders, unable to overcome complaints from both moderate and conservative members of their caucus, said the skeletal plan was just a vehicle to permit negotiations with the House, which passed a much more ambitious repeal bill in early May.
The “skinny repeal” bill, as it became known at the Capitol this week, would still have had broad effects on health care. The bill would have increased the number of people who are uninsured by 15 million next year compared with current law, according to the nonpartisan Congressional Budget Office. Premiums for people buying insurance on their own would have increased roughly 20 percent, the budget office said.
Unlike previous setbacks, Friday morning’s health care defeat had the ring of finality. After the result was announced, the Senate quickly moved on to routine business. Mr. McConnell canceled a session scheduled for Friday and announced that the Senate would take up the nomination of a federal circuit judge on Monday afternoon.
With so many senators in both parties railing against the fast-track procedures that Republican leaders used, a return to health care seemed certain to go through the committees, where bipartisanship and deliberation are more likely.
“We are not celebrating,” said the Senate Democratic leader, Chuck Schumer of New York. “We are relieved that millions and millions of people who would have been so drastically hurt by the three proposals put forward will at least retain their health care, be able to deal with pre-existing conditions.”
Mr. McConnell said he was proud of his vote to start unwinding the Affordable Care Act. “What we tried to accomplish for the American people was the right thing for the country,” Mr. McConnell said. “And our only regret tonight, our only regret, is that we didn’t achieve what we had hoped to accomplish.”