– The Senate voted narrowly Tuesday to begin debate on a bill to repeal major provisions of the Affordable Care Act, but hours later, GOP leaders suffered a setback when their most comprehensive plan to replace former President Barack Obama's health law fell far short of the votes it needed.

The Tuesday night tally needed to reach 60 votes to overcome a parliamentary objection. Instead, it fell short, 43-57. The fact that the comprehensive replacement plan came up well short of even 50 votes was an ominous sign for GOP leaders still seeking a formula to pass final health care legislation this week.

For Republicans, the failure ended the day on a sour note, hours after a more triumphant scene on the Senate floor. Lawmakers from both parties had risen to their feet in the afternoon and applauded when Sen. John McCain, R-Ariz., showed up in the chamber despite his diagnosis of brain cancer. He cast a crucial vote in favor of opening what promises to be a freewheeling, hard-fought debate over the future of the Affordable Care Act.

The 51-50 vote to start debate, with Vice President Mike Pence breaking a tie, came only a week after the Republican effort to dismantle a pillar of Obama's legacy appeared all but doomed. It provided an initial win for President Donald Trump, who pushed, cajoled and threatened senators in recent days to at least begin debating the repeal of the health care law.

But the victory could be fleeting: Senate Republicans still have no agreement on a repeal bill that they can ultimately pass to uproot the law that has provided health insurance to millions of Americans.

The Senate is now moving ahead with debate, amendments and ultimately a final vote in the coming days on legislation that would have a profound effect on the American health care system — roughly one-sixth of the U.S. economy. But it is entirely possible that by week's end, they will have passed nothing.

"Now we move forward towards truly great health care for the American people," Trump said from the White House Rose Garden, where he was holding a news conference with the visiting prime minister of Lebanon. "This was a big step."

Only two Republicans, Sens. Susan Collins of Maine and Lisa Murkowski of Alaska, voted against the procedural motion, although at least several other Republicans had been seen as possible holdouts. No Democrats voted in favor of the motion.

The Tuesday night vote was on a comprehensive amendment that included disparate proposals calculated to appeal to conservatives and moderates in the Republican caucus.

One proposal, offered by Sen. Ted Cruz, R-Texas, would have allowed insurers to sell stripped-down health plans, without maternity care or other benefits required by the ACA, if they also sold plans that included such benefits.

"You shouldn't have to buy what the federal government mandates you must buy," Cruz said. "You should choose what meets the needs for you and your family."

The amendment also included money to help pay out-of-pocket medical costs for low-income people, including those who buy private insurance after losing Medicaid coverage as a result of the Senate bill. This proposal was devised by Sen. Rob Portman, R-Ohio, and other senators from states that have expanded Medicaid.

But nine Republicans, spanning the party's ideological spectrum, voted against the package. The debate to come will have broad implications for health care and households in every state, and emotions are high.

Before senators voted to start the debate in midafternoon, protesters in the Senate gallery chanted, "Kill the bill, don't kill us!" and "Shame, shame, shame!"

Despite his vote to move ahead, McCain offered harsh words for the secretive process by which Senate Republican leaders came up with their bill to repeal and replace the health law.

Arizona is one of the 31 states that expanded Medicaid under the Affordable Care Act, and McCain's remarks could reflect concerns of other senators from states that expanded Medicaid, including the junior Republican senator from his state, Sen. Jeff Flake.

"We are ground zero for the failure of the exchanges, but we are also an expansion state," Flake said. "I think all of us are concerned that we don't pull the rug out from people."

Just before the Senate vote, Minority Leader Chuck Schumer made an impassioned plea to Republicans.

"We know that ACA is not perfect," Schumer said. "But we also know what you've proposed is much worse. We can work together to improve health care in this country. Turn back now before it's too late and millions and millions and millions of Americans are hurt so badly in ways from which they will never, ever recover."

GOP leaders in Congress have struggled all year to fulfill their promise of repealing the 2010 health care law. By a vote of 217-213, the House approved a repeal bill in early May, but only after Republicans overcame their own difficulties in that chamber.