Washington(CNN) The Senate has dealt a devastating setback to Republican efforts to repeal and replace Obamacare, defeating a GOP "skinny repeal" bill early Friday morning.

Sens. John McCain, Lisa Murkowski and Susan Collins joined with Democrats to oppose the measure, a major blow to President Donald Trump and the Republican congressional agenda.

McCain, who had voted for a motion to proceed to the bill Tuesday after returning to Washington following surgery for a brain tumor, held out all day, including in a news conference where he criticized the partisan process that led to the after-midnight vote.

His surprise decision came after a prolonged drama on the Senate floor. Multiple Republican colleagues, including Vice President Mike Pence, engaged in animated conversations with the Arizona senator who has long cherished his reputation as a maverick.

At one point before the final vote, Trump called Pence, who handed the phone to McCain, a source briefed on the call told CNN. The call, just off the Senate floor, was brief and ultimately unsuccessful.

Cryptic calls, lip-reading and a thumbs-down: Behind McCain's dramatic vote

Republican lawmakers have had several fits and starts this year, including a dramatic vote in the Senate earlier this week -- but the failure lays bare a hard-to-swallow political reality for Republicans after months of painful negotiations and soul-searching: There is little will left in the GOP to gut a health care law that the party has been railing against for seven years.

Speaking after the vote, Senate Majority Leader Mitch McConnell looked stunned and lamented the vote and the inability of the GOP to fulfill its long-term campaign pledge.

"This is clearly a disappointing moment," McConnell said. "Our constituents have suffered through an awful lot under Obamacare. We thought they deserved better. It's why I and many of my colleagues did as we promised and voted to repeal this failed law. We told our constituents we would vote that way. And when the moment came, when the moment came, most of us did."

"It's time to move on," he said, moving the Senate on to the defense authorization bill.

Trump in an early morning tweet reacted to the Senate vote, writing "3 Republicans and 48 Democrats let the American people down. As I said from the beginning, let ObamaCare implode, then deal. Watch!"

After the vote, McCain called for a return to the committee process and criticized the partisan manner of the current health care effort -- harkening back to his emotional floor speech Tuesday when he returned to Washington.

"I've stated time and time again that one of the major failures of Obamacare was that it was rammed through Congress by Democrats on a strict-party line basis without a single Republican vote," McCain said in a statement. "We must now return to the correct way of legislating and send the bill back to committee, hold hearings, receive input from both sides of aisle, heed the recommendations of nation's governors, and produce a bill that finally delivers affordable health care for the American people. We must do the hard work our citizens expect of us and deserve."

How it failed

Shortly before 10 p.m. ET, Republican leaders finally unveiled legislation that had been closely guarded from the public -- as well as their own colleagues -- for days.

The legislation, referred to as a "skinny repeal" bill, would repeal the Affordable Care Act's individual and employer mandates and temporarily repeal the medical device tax. The bill would also give states more flexibility to allow insurance that doesn't comply with Obamacare regulations.

CNN Money: What's in the Senate 'skinny repeal' health care bill?

The bill would mean 15 million more people would be uninsured next year than under Obamacare, with 16 million more in 2026, the Congressional Budget Office said in a report released late Thursday night. Premiums would jump 20% next year, compared to current law.

But just hours away from a vote, which ultimately ended close to 2 a.m. ET, the Republicans were still in trouble.

McCain and several of his colleagues had thrown the Republican negotiations into turmoil earlier in the day, when they threatened to scuttle the bill unless they were offered guarantees that the House would enter negotiations after the Senate passed it. The fear was that the House would end up passing the "skinny bill" rather than a more comprehensive effort.

In an early afternoon press conference, GOP senators savaged the "skinny repeal" bill.

"I'm not going to vote for a bill that is terrible policy and politics just to get something done," Sen. Lindsey Graham said at a news conference, joined by McCain, Ron Johnson and Bill Cassidy.

Shortly after that news conference, Ryan responded that the House would be willing to go to a conference committee but his carefully crafted statement did not include a specific guarantee that the House would not vote on the Senate's proposal. It appeared aimed at moving the process forward while protecting House Republicans from being blamed if the entire process collapsed.

"The burden remains on the Senate to demonstrate that it is capable of passing something that keeps our promise, as the House has already done," Ryan said. "Until the Senate can do that, we will never be able to develop a conference report that becomes law."

Ryan also held a conference call with some of the Senate holdouts. Graham and Johnson backed the GOP plan. But McCain wasn't moving.

"I think John is rightfully upset with the process and whatever he does, he's earned the right to do it," Graham told reporters.

As he received a barrage of questions from reporters about the Senate's strategy of passing something that it doesn't ultimately want the House to pass, Sen. John Cornyn, the second-ranked Republican, came back with this quip: "I guess we ought to go back to Schoolhouse Rock."

Senate Minority Leader Chuck Schumer said Ryan's statement was insufficient as well.

"That is not worth anything," Schumer, D-New York, said on the Senate floor. "They want to pass this bill, skinny repeal, and send it to the President."

Threat to Murkowski?

Leadership's careful maneuvering -- a "high-wire act," Cornyn called it Wednesday -- came as the Trump administration was pursuing a different tact, according to a report in the Alaska Dispatch News.

According to that report, Interior Secretary Ryan Zinke called Alaska Sens. Lisa Murkowski and Dan Sullivan and informed them that Murkowski's opposition to the vote Tuesday to start debate "put Alaska's future with the administration in jeopardy."

Murkowski chairs the panel that's jurisdiction includes oversight of the Interior Department -- and Zinke.

The other Republican who voted against Tuesday's motion, Maine's Susan Collins, said she has not heard from the White House since that vote.

Asked directly if she's received any threats from the White House, Collins said, "No."

RELATED: What's inside the House-passed bill?