WASHINGTON (Reuters) - U.S. Senate Republicans narrowly agreed on Tuesday to open debate on a bill to end Obamacare, but the party’s seven-year effort to roll back Democratic President Barack Obama’s signature healthcare law still faces significant hurdles.

The Senate deadlocked 50-50 on moving forward with the healthcare debate, forcing Vice President Mike Pence to cast the tie-breaking vote.

Senator John McCain, who was diagnosed this month with brain cancer and has been recovering from surgery at home in Arizona, made a dramatic return to the U.S. Capitol to cast a crucial vote in favor of proceeding.

The outcome was a huge relief for President Donald Trump, who had pushed his fellow Republicans hard in recent days to live up to the party’s campaign promises to repeal the 2010 Affordable Care Act, commonly known as Obamacare. Minutes after the vote, Trump called it “a big step.”

But the narrow victory on a simple procedural matter raised questions about whether Republicans can muster the votes necessary to pass any of the various approaches to repeal.

Moderates are worried repeal will cost millions of low-income Americans their insurance and conservatives are angry the proposed bills do not go far enough to gut Obamacare, which they consider government overreach.

In a first vote of the many likely to come this week, the plan to repeal and replace Obamacare that Senate Republicans have been working on for months failed to get the 60 votes needed for approval on Tuesday night. The vote was 43 in favor and 57 against.

Nine Republicans, ranging from moderates such as Susan Collins of Maine to conservatives such as Rand Paul of Kentucky, voted against the bill, which would have made deep cuts to Medicaid, the health insurance program for the poor, and reduced Obamacare subsidies to lower-income people to help them defray the cost of health insurance.

Earlier McCain, 80, received an ovation from his fellow senators when he entered the chamber to cast a vote to open debate. After that vote, he decried growing partisanship in the Senate and urged members to learn how “to trust each other again.”

Collins and Senator Lisa Murkowski were the only Republicans to oppose the measure to open debate, and with Republicans controlling the Senate by a 52-48 majority, those were the only votes the party leadership could afford to lose. Democrats were united in opposition to the motion to proceed.

Republican Senator Ron Johnson, who cast the last and deciding vote to open debate, engaged in a heated discussion with Senate Majority Leader Mitch McConnell before casting his vote and ending the suspense.

INSURERS, HOSPITALS WORRIED

A loss on the vote to open debate on Tuesday could have been a death blow for Republican efforts to repeal Obamacare and cast doubt on Trump’s prospects to achieve any of his other top legislative agenda items, including tax reform.

“We have a duty to act,” McConnell told senators before the vote, reminding Republicans they had promised to repeal Obamacare in four straight elections. “We can’t let this moment slip by.”

Republicans have found it difficult to fulfill their campaign promises to repeal Obamacare, which enabled 20 million more Americans to get health insurance.

Polls show Obamacare is now far more popular than the Republican alternatives. The nonpartisan Congressional Budget Office has estimated the Senate’s replacement bill could lead to as many as 22 million fewer Americans being insured.

The health industry has watched the debate nervously, and after the vote some groups urged the Senate to reconsider its approach.

Slideshow ( 18 images )

America’s Essential Hospitals, a group representing safety-net hospitals, said in a statement it strongly opposed all the Republican plans and feared the big cuts in Medicaid in the bills “would jeopardize the health and financial security of millions of working people and families.”

Shares in health insurer Centene Corp CNC.N turned sharply lower after the Senate vote. Earlier on Tuesday, the company had reported a better than expected profit as it benefits from a strong Obamacare business.

‘KILL THE BILL’

As the debate vote opened, more than two dozen protesters in the Senate chamber chanted “kill the bill” before they were removed.

Slideshow ( 18 images )

Senators said several approaches have been discussed, including a straight repeal of Obamacare with no replacement plan, or repealing and replacing the law while also overhauling Medicaid.

Senate Republicans also could consider a shortened version of repeal, called a “skinny repeal,” which would end the mandates in Obamacare on individuals and employers to obtain or provide health insurance, and a medical device tax, a Senate aide and a lobbyist said.

“Some of us want clean repeal, some of us want the Senate leadership bill, they’re both going to get a vote early on and I think that’s a fair way to do it,” Republican Senator Rand Paul said. “If either one of them fails and another one succeeds, maybe we can find something in between that actually succeeds.”

Republican Senator Bob Corker said the goal was to gain enough votes to get a bill through the Senate and send it to the House of Representatives, which passed its own bill to replace Obamacare in May, for negotiations.

“Everybody understands this is just a first step,” he said.

Several of the Democrats opposing the motion for debate were from conservative states that backed Trump in 2016 and face tough re-election bids next year, including Senators Joe Manchin of West Virginia, Heidi Heitkamp of North Dakota and Jon Tester of Montana.

“We have a good chance to beat this,” Senate Democratic Leader Chuck Schumer told reporters after the vote.

Dick Durbin, the No. 2 Senate Democrat, praised Collins and Murkowski for taking a principled stand against the Republican move to open debate.

“That wasn’t easy,” Durbin said. “That was an act of political courage on their part; I’m sure they were under tremendous pressure.”