Trump, for his part, contended that the senators who opposed the plan "let the American people down." He added: "as I said from the beginning, let ObamaCare implode, then deal."
While Trump has previously suggested letting Obamacare "implode," as a candidate and as president he has usually promoted repealing and replacing Obamacare.
The so-called skinny repeal bill, which the GOP titled the Health Care Freedom Act, would have rolled back several Obamacare provisions, including the key individual and employer mandates.
The bill would have led to an estimated 16 million more Americans uninsured by 2026, according to a late Thursday report from the nonpartisan Congressional Budget Office. Premiums in the nongroup market would increase "by roughly 20 percent relative to current law in all years between 2018 and 2026," the CBO estimated.
Following the vote, Senate Minority Leader Chuck Schumer said Democrats "are not celebrating" but are "relieved" for Americans. He urged the Senate to return to regular order and the committee process on legislation, highlighting the speech McCain made with a similar sentiment when he returned to the Senate Tuesday.
"All of us were so inspired by the speech and the life of the senator from Arizona," Schumer said, tearing up. "And he asked us to go back to regular order ... maybe this can be a moment when we start doing that."
When the Senate voted to start debate on Obamacare repeal Tuesday, two Republicans — Collins and Murkowski — opposed the measure. Following a cross-country trip, the 80-year-old McCain, with a scar above his left eye, cast the deciding vote to move forward with debate.
Going into Thursday's votes, Collins and Murkowski were widely considered the most likely Republicans to oppose the plan. Murkowski cast her "no" vote following reported warnings from the Trump administration after her break from the Republicans earlier this week.
McCain's vote early Friday came as more of a surprise.
"I thought it was the right vote," McCain said as he left the Capitol, according to NBC News.
McCain expanded on that in a later statement, saying that skinny repeal would not offer a real replacement that would increase competition and lower health-care costs.
"We must now return to the correct way of legislating and send the bill back to the 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," he said in a statement.
Just before the vote that blocked the skinny repeal, all votes had been cast on a separate Democratic amendment that ended up failing. The vote remained open as several senators moved to talk to both McCain and Murkowski.
Vice President Mike Pence, who was at the Capitol to cast a potential tie-breaking vote, spent considerable time speaking to McCain, according to reporters in the area. The Arizona senator could eventually be seen laughing with Schumer and hugging Sen. Dianne Feinstein, D-Calif.
Trump, who has been frustrated by the pace of Obamacare repeal despite inconsistent engagement on policy, had cheered McCain as a deciding health-care vote earlier this week.
It is not clear what actions Congress could take on health care from this point. In his remarks Friday, McConnell said it will be "interesting to see what [Democrats] suggest is the way forward."
Added McConnell: "It's time to move on."