It took until the wee hours of the morning, but members of Senate voted against an Obamacare repeal bill by a 49-51 margin Friday.

The vote took place at around 1:30 a.m. EST with plenty of eyes looking on despite the time on the clock. Vice President Mike Pence sat in to cast the deciding vote, if necessary. But in the end, it was decided by three Republican “NO” votes. They were cast Lisa Murkowski of Alaska, Susan Collins of Maine and John McCain of Arizona.

President Donald Trump, who campaigned immensely on repealing and replacing Obamacare, vented his disappointment with the Senate decision shortly after the vote. He said that McCain, Murkowski and Collins — along with 48 Democrats — “let the American people down.”

3 Republicans and 48 Democrats let the American people down. As I said from the beginning, let ObamaCare implode, then deal. Watch! — Donald J. Trump (@realDonaldTrump) July 28, 2017

The three Republicans, along with those 48 Democrats voted “NO” on the “Skinny Repeal” amendment, a piece of legislation that wasn’t unveiled to the Senate members until about 10 p.m. Thursday. If it was approved by Senate and then signed by Trump, the “Skinny Repeal” would have repealed the individual and employer mandates and essentially gutted Obamacare.

A report released by the Congressional Budget Office on Thursday said the piece of legislation would have added another 16 million uninsured people by 2026 under Obamacare.

Hours before the vote took place, Trump encouraged Republican senators to push the repeal across the finish line.

Go Republican Senators, Go! Get there after waiting for 7 years. Give America great healthcare! — Donald J. Trump (@realDonaldTrump) July 28, 2017

Instead, it looks as if it’s back to the drawing board once again for the GOP in relation to healthcare.

For much of the evening and into the morning, it wasn’t known which way McCain would vote on the matter. His “NO” vote comes just days after he made a dramatic return to Senate after being diagnosed with brain cancer. He delivered an emotional plea to his colleagues inside of the Senate chamber.

“As I stand here today — looking a little worse for wear I’m sure — I have a refreshed appreciation for the protocols and customs of this body, and for the other ninety-nine privileged souls who have been elected to this Senate,” McCain said during his speech Tuesday.

It should be noted that Trump publicly attacked McCain while on the campaign trail. In July 2015, then-candidate Trump denied that McCain was ever a war hero despite being captured in Vietnam and being tortured as a prisoner of war.

“He’s not a war hero,” Trump said. “He was a war hero because he was captured. I like people who weren’t captured.”

Similar to Trump, McCain had campaigned on repealing and replacing Obamacare. Instead, his current health diagnosis may have played a role in his decision to vote the other way. He released a statement after the vote saying that the “Skinny Repeal” amendment wouldn’t have accomplished his goals with healthcare, adding that it’s time to work together to find something that works for all Americans.

From the beginning, I have believed that Obamacare should be repealed and replaced with a solution that increases competition, lowers costs, and improves care for the American people. The so-called ‘skinny repeal’ amendment the Senate voted on today would not accomplish those goals. While the amendment would have repealed some of Obamacare’s most burdensome regulations, it offered no replacement to actually reform our health care system and deliver affordable, quality health care to our citizens. The Speaker’s statement that the House would be ‘willing’ to go to conference does not ease my concern that this shell of a bill could be taken up and passed at any time. 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. We should not make the mistakes of the past that has led to Obamacare’s collapse, including in my home state of Arizona where premiums are skyrocketing and health care providers are fleeing the marketplace. 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.

After the vote, both and Senate Minority Leader Chuck Schumer and Senate Majority Leader Mitch McConnell had an opportunity to address Senate before it was dismissed.

Schumer thanked McCain for his vote and said it’s time members of Senate heed his advice.

“All of us were so inspired by the speech and the life of the senator from Arizona,” Schumer said.

Schumer added that it’s time to work together to fix Obamacare instead of repealing it outright without a solid plan to replace it.

“It’s time to turn the page,” he said. “I would say to my dear friend, the majority leader, we are not celebrating. We are relieved that millions and millions of people that would have been so drastically hurt by the three proposals put forward will at least retain their healthcare, be able to deal with pre-existing conditions, deal with nursing homes and opioids that Medicaid paid for.

“We are relieved. Not for ourselves, but for the American people.”

McConnell, who had tried to move forward with the outright repeal of Obamacare, was understandably upset with the result.

“This is clearly a disappointing moment,” McConnell said. “From skyrocketing costs to plummeting choices and collapsing markets, our constituents have suffered through an awful lot with 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.”