Follow CBSMIAMI.COM: Facebook | Twitter

WASHINGTON (CBSMiami) – In a surprising, dramatic night, the so-called Republican health care “skinny’ bill to repeal the Affordable Care Act, aka Obamacare, got voted down.

That vote, which came around 1:30 a.m., all but ended Republican efforts to repeal and replace Obamacare.

At the center of it all, Senator John McCain, who just returned to the Senate floor after being diagnosed with brain cancer. It was his vote that made the difference.

A crowd of Obamacare supporters outside the Capitol building cheered after learning the bill had failed to pass. Sen. Bernie Sanders joined them and called it a big victory.

“Tonight was a victory for the American people, it was a victory for 16 million people who would’ve been thrown off health care,” said Sanders, I-VT.

The vote was 49-to-51. After seven years trying to undo the Affordable Care Act, Senate Majority Leader Mitch McConnell says, it’s time to move on for now.

“This is um clearly a disappointing moment. Now I imagine many of our colleagues on the other side are celebrating,” said Senate Majority Leader Mitch McConnell, R-KY.

“We are not celebrating, we are relieved that millions and millions of people that would’ve been so drastically hurt by the three proposals put forward, will at least retain their health care,” said Sen. Chuck Schumer, D-NY.

The key moment of what was a dramatic, all-night session of debating and voting came from Senator John McCain. He was the third Republican to vote no, killing the measure.

McCain defended his vote on Twitter afterward saying the “Skinny repeal fell short because it fell short of our promise to repeal & replace Obamacare w/ meaningful reform.”

President Trump responded in an early morning tweet.

The Senate has adjourned until Monday, July 31 at 4:00 pm. When they return on Monday they will consider the nomination of Kevin Newsom to be U.S. Circuit Judge for the Eleventh Circuit.