After a months-long struggle, Republicans have succeeded in bringing Obamacare repeal legislation, a centerpiece of their 2016 election campaigns, to a debate on the U.S. Senate floor. Now the hard part begins.

Republicans, deeply divided over the proper role of the government in helping low-income people receive health care, eked out a procedural win on Tuesday when the Senate voted 51-50, with Vice President Mike Pence breaking a tie, to allow debate to start on legislation.

The outcome came as a huge relief to President Donald Trump, who has called Obamacare a "disaster" and pushed fellow Republicans in recent days to follow through on the party's seven-year quest to roll back the law.

But hours later, Senate Republican leadership suffered a setback when the repeal and replace plan that they had been working on since May failed to get enough votes for approval, with nine out of 52 Republicans voting against it.

Usually, bills reach the floor with a predictable outcome: Senators have received summaries of the legislation to be debated that were written in an open committee process, leaders have counted the number of supporters and opponents, amendments are debated and everybody knows the likely outcome: passage.

All that is out the window now, as the Senate on Wednesday continues a freewheeling debate that could stretch through the week on undoing major portions of former Democratic President Barack Obama's signature Affordable Care Act, which expanded health insurance to about 20 million people, many of them low-income.

Republican leaders have insisted they can devise a cheaper approach this week and with less government intrusion into consumers' health-care decisions than Obamacare.

Democrats and other critics of the Republican effort said it would deprive millions of health coverage.

"We've tried to do this by coming up with a proposal behind closed doors in consultation with the administration, then springing it on skeptical members, trying to convince them it's better than nothing, asking us to swallow our doubts and force it past a unified opposition," Republican Senator John McCain said on Tuesday.

"I don't think that is going to work in the end. And it probably shouldn't," he added.

The veteran Arizona lawmaker made his remarks after receiving a standing ovation from his colleagues, as he returned to the Senate just days after surgery and being diagnosed with brain cancer.

McCain appealed to Senate Majority Leader Mitch McConnell to start over by having a Senate committee, in a bipartisan way, craft new health-care legislation.

His proposal was promptly ignored.

'Skinny' bill gets traction

As senators grind through potentially scores of amendments in coming days — in a process called a "vote-a-rama" — they will have more than McCain's scorn to worry about.

Health-care industry organizations are similarly troubled.

"We strongly oppose all plans so far to replace the Affordable Care Act and have no confidence lawmakers can overcome the flaws in these proposals," said America's Essential Hospitals, a group representing hospitals that treat poor people.

Like McCain, the group urged the Senate, narrowly controlled by Republicans, to halt its work on Obamacare repeal legislation and begin a bipartisan effort on health care.

The Republican drive to "repeal and replace" Obamacare has taken many unexpected turns since the House of Representatives began working on its version of legislation last March.

For now, many Republican senators are wondering whether they may end up going to a Plan B — a "skinny" health-care bill that would simply end Obamacare's penalties for individuals and employers that do not obtain or provide health insurance, as well as abolish a medical device tax.

It would then be up to a special Senate-House committee to come up with a final bill that could take many turns during the negotiation.

After Tuesday's nail-biter Senate vote setting up the floor debate, McConnell may have best summed up the landscape facing the chamber's 100 senators.

"This is just the beginning," he told reporters.

To view this site, you need to have JavaScript enabled in your browser, and either the Flash Plugin or an HTML5-Video enabled browser. Download the latest Flash player and try again.