WASHINGTON — With Vice President Mike Pence casting a tie-breaking vote, Republicans moved forward on health care reform Tuesday as the Senate successfully opened debate on the issue. But just six hours later, Republicans faced their first defeat in that process, failing to pass a measure that they've been working on that would have partially repealed and replaced Obamacare.

The vote earlier in the day was a major victory for Republicans, who have struggled to find 50 votes to get this far, but the final product is likely to fall far short of the Republicans' seven-year promise to get rid of the Affordable Care Act. It took the likelihood of a slimmed-down final bill in order to get enough "yes" votes to just open debate.

President Donald Trump celebrated the Senate's vote Tuesday night in Youngstown, Ohio, saying at a rally that America is now "one step closer to liberating our citizens from this Obamacare nightmare."

"Finally," he said to a crowd of thousands of supporters at the campaign-style event. "You think that's easy? That's not easy."

While the president told his fans that he hoped that "obstructionists, meaning Democrats" would "finally do what's right" and join efforts to repeal and replace Obamacare, Trump predicted that Republicans will likely have to go it alone — as they did Tuesday. "Today we won 51 to 50 and didn't get a single Democrat vote," he said. "Think of that."

But later in the evening, the Senate took its first substantive vote on a beefed-up version of the Better Care Reconciliation Act, a measure that would partially repeal and replace Obamacare. That vote failed to garner the requisite 60 votes necessary and put an end for the time being of a large comprehensive health care bill.

Earlier in Washington, momentum built over the course of the day as several previously skeptical members announced their support after Senate GOP leaders began detailing plans for more votes over the next days to shape the specifics of the legislation.

In a dramatic moment that allowed for the vote's passage, Sen. John McCain, R-Ariz., who was recently diagnosed with brain cancer, returned to the Senate from Arizona to cast a key vote. Pence broke the tie after two Republicans — Susan Collins, R-Maine, and Lisa Murkowski, R-Alaska — and all the Democrats voted against it. But first more than a dozen protesters in the gallery interrupted the Senate's proceedings, chanting, "Kill the bill; don't kill us."

Speaking at the White House just minutes after the vote, President Donald Trump thanked Senate Republicans, saying, "now we move forward with truly great health care for the American people, we look forward to that. This was a big step."

Senate Majority Leader Mitch McConnell said before the vote that it was "a critical first step."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"We can’t let this moment slip by. We’ve talked about this too long," McConnell added.

Now that the the Senate has opened up debate, the next few days will consist of debate and votes on perhaps dozens of amendments.

The final product is unknown but is likely to end up as what's being called a “skinny” repeal that disposes of just a few components of Obamacare.

The first vote was on the Better Care Reconciliation Act, with an amendment from Sen. Ted Cruz, R-Texas, that would provide for the sale of catastrophic insurance plans that are less expensive and provide less protection than allowed under Obamacare. The bill also included an amendment by Sen. Rob Portman, R-Ohio, that would add $100 billion in additional spending to help low-income people pay for premiums and co-pays, especially those who might lose Medicaid coverage due to cuts to the program.

But the BCRA amendment needed 60 votes because neither the Cruz nor the Portman provisions have been scored by the Congressional Budget Office, leaving no clear indication of how much they would cost or how many people they would affect. That means it cannot pass under special reconciliation rules allowing a simple majority approval. It fell far short with nine Republicans and all Democrats voting against it.

One of the next votes, likely Wednesday, will be on a version of the Obamacare repeal bill that passed the Senate and the House in 2015 but was vetoed by President Barack Obama.

The plan after those two votes is for senators to proceed to votes on a series of amendments to create the “skinny” repeal, which is a watered-down version of repeal with nothing to replace it.

The goal would be to eliminate Obamacare's individual mandate penalty, the employer mandate penalty, and the tax on medical devices —items that Senate leaders think might be able to get 50 votes. A broader repeal would also have ended Medicaid's expansion, get rid of or replace the Obamacare subsidies that help people purchase insurance and repeal more — or all — of Obamacare's taxes.

The Senate would then go to conference with the House of Representatives, where conferees would work out a final bill. Both chambers would then have to vote on the reconciled bill.

"The proposal Leader McConnell made is nothing more than a ruse," Senate Minority Leader Chuck Schumer said on the Senate floor. "We’re going to do everything we can in this chamber, and the so many groups outside the chamber, to make sure that this does not pass the Senate at the end of the day."

While the plan is is unlikely to result in a full repeal or replace, the scaled-down ambition was enough for senators who have been critical throughout the process to vote "yes" on today's motion to open up debate.

"It's just time to have debate," said Sen. Dean Heller, R-Nev., who had earlier said he would not vote to debate the Senate bill. "So let's have the debate. Move forward. Let's get it out of the backrooms. Let's get it out on the Senate floor. And let's move forward." He did not indicate how he'd vote on the various measures that will come up in the days to come.

The dramatic return of McCain — who received a standing ovation on the Senate floor — helped give GOP leaders not only a crucial vote but a morale boost for the GOP conference.

While passage of the motion to proceed had been in doubt for weeks, the momentum began to shift Tuesday morning. Sen. Rand Paul, R-Ky., announced in a series of tweets that he supports this plan and would vote "yes" on the motion, saying he was satisfied after being promised a vote on a near-full repeal and that the repeal-and-replace plan will likely fail.

If this is indeed the plan, I will vote to proceed and I will vote for any all measures that are clean repeal. — Senator Rand Paul (@RandPaul) July 25, 2017

A handful of other GOP senators who had also been skeptical of the Senate bill came on board to move ahead, including Sens. Shelley Moore Capito, R-W.V., Mike Lee, R-Utah, and Jerry Moran, R-Kan.

But there was some last-minute drama that led people to question if the vote would really pass, provided by Sen. Ron Johnson, R-Wisc., who has been highly critical of the process and Senate Majority Leader Mitch McConnell. Nearly 25 minutes after the vote began, Johnson walked onto the floor, didn't vote, and proceeded to get into a heated discussion with McConnell that lasted five minutes. Johnson and McCain had not yet voted when the Arizona senator walked on the floor and cast his vote. Then Johnson voted "yes," giving Republicans their 50th vote.

Over the last two days, Trump finally engaged fully on health care, using his bully pulpit and his Twitter account to pressure — and shame — Republicans into voting for the bill.

Democrats are working to defeat the bill, holding rallies, including one on the Capitol steps after Tuesday's vote. They are also meeting and hosting people, including children who depend on coverage they've received under Obamacare, to lobby against repeal.

Ali Vitali reported from Youngstown, Ohio.