WASHINGTON — Republicans' halting effort to dismantle the Affordable Care Act gained new life Tuesday as the Senate cleared a procedural roadblock and voted to begin debate on a still-undefined GOP plan.

The 51-50 vote, with a tie broken by Vice President Pence, came just days after the push had appeared to have fallen flat in the Senate, but as President Trump and fellow Republicans pressed to show progress on a core promise to overhaul the health law often called "Obamacare."

"Now we're all going to sit together and we're going to try and come up with something that's really spectacular. We have a lot of options and a lot of great options," Trump said at a news conference shortly after the vote.

Even as they voted, though, Republicans were unsure what their plan will consist of, and still faced significant obstacles. They hold a two-vote majority in the Senate, and conservatives and moderates are pulling in opposite directions on a proposal that could affect health care for millions across the country. Further amendments, possibly as soon as this week, will shape the bill that could ultimately get an up-or-down vote.

Late Tuesday night the voting began with Democrats and nine Republicans defeating the idea that has received the most attention so far, a Senate GOP bill to repeal and replace the law. A proposal to simply repeal the law in two years is scheduled to come up next, but also faces almost certain defeat.

Still, for GOP leaders Tuesday afternoon's procedural vote was a vital step. By avoiding defeat, they kept their long-standing repeal promise alive and built momentum for the first time in months. Whatever the final proposal, passing anything would set the stage for negotiations with the House, a process that could produce yet another version, or House approval of the Senate plan — which would finally deliver Trump the major legislative victory he has craved.

As the tense roll call unfolded after weeks of wrangling by GOP leaders and public threats by Trump, lawmakers sat quietly in their seats. Centrist Republican Sens. Susan Collins of Maine and Lisa Murkowski of Alaska voted no, but several other Republican holdouts changed their stands and voted to support the procedural step. Democrats stared coldly across the aisle, and protesters chanted "Kill the bill" until they were removed. Trump's health secretary, Tom Price, watched on the Senate floor. With the procedural step on the brink of approval, Sen. John McCain (R., Ariz.) returned to the Senate for the first time since receiving treatment for brain cancer. Applauded by senators from both parties, he hugged the Democratic leader, Sen. Charles Schumer, and then voted yes.

McCain then delivered a withering speech blasting the GOP's closed-door process — which he had voted to advance — and said he still expects the effort to end in failure. He said he'd vote against the Senate's replacement plan as it currently stands.

"I hear the Senate referred to as the world's greatest deliberative body. I'm not sure we can claim that distinction with a straight face today," he said, sharply criticizing his own leaders for drawing up a bill in private, holding no hearings, and arguing that their version would be "better than nothing."

His vote and speech illustrated the precarious situation for Republicans, who have vowed for nearly a decade to repeal and replace the ACA but have a narrow Senate majority and deep internal divides on what their alternative should look like.

Trump called it a "very narrow path, like a quarter of an inch wide," adding: "It is a very, very complex and difficult task. But it's something I actually know quite a bit about."

Democrats unanimously opposed the procedural step, saying that instead of repealing the ACA, it should be tweaked with bipartisan fixes.

Schumer, of New York, called the vote Tuesday a "ruse" opening the door to a conservative bill that would slash Medicaid, the health program for poor and disabled people, cut taxes for the wealthy, and end protections for people with expensive preexisting conditions.

"We know the ACA is not perfect, but we also know what you've proposed is much worse," he said on the Senate floor. "Turn back now before it's too late and millions and millions and millions of Americans are hurt so badly."

What exactly the Republican plan will include was unclear.

In deciding to begin debate, they opened an amendment process that could lead almost anywhere, leaving Republicans to essentially craft the bill on the fly.

They are expected to vote on ideas ranging from repealing the ACA entirely without an immediate replacement to replacing the law with a Senate GOP plan that proved highly unpopular when it was first offered — neither of which is likely to pass. The newest possibility discussed was a more narrow set of changes killing specific unpopular pieces of the law, like the mandate that everyone buy insurance. Several key provisions in early GOP plans are expected to be nixed by the complex Senate rules being employed, casting further doubt on Republican support.

Despite the murky path forward, Senate Majority Leader Mitch McConnell (R., Ky.) urged colleagues to vote yes to provide relief from the "failed left-wing experiment" that he blamed for rising premiums and diminishing choices.

"I'd like to reiterate what the president said yesterday. 'Any senator who votes against starting debate,' he said, 'is telling America that you are fine with the Obamacare nightmare,' " McConnell said on the Senate floor. He later said the vote would give Republicans a chance to keep their promises. "I hope everyone will seize the moment."

Democrats warned that the plans, regardless of the final version, could cost millions their health coverage.

"This bill is a wrecking ball for our health-care system," Sen. Bob Casey (D., Pa.) said before the vote. "Rural hospitals will close, jobs will be lost."

Republican proposals until this point have focused on drastically cutting projected Medicaid spending — in some versions by 26 percent over the next decade, according to a nonpartisan analysis — and eliminating the taxes and mandates that underpin the ACA. They argue that freeing employers and consumers from the law's requirements will lead to more competition and less expensive coverage. Democrats counter that Republicans are undermining a program that has expanded health coverage to millions and offers protections that make insurance affordable for people with expensive medical conditions, pregnant women, and others.

Analyses by the nonpartisan Congressional Budget Office have predicted that previous Republican plans would generally lead to lower premiums for younger, healthier people, but higher deductibles and less generous health coverage for people who need the most health care, including older people or those with expensive conditions.

The Philadelphia region's lone Republican senator, Pat Toomey, supported the GOP effort. He has argued that Pennsylvanians need relief from the ACA's flaws.

Every Democrat from the area opposed the plan and rallied to the defense of a once-unpopular law, citing CBO estimates that the original Republican plan would swell the ranks of the uninsured by more than 20 million by 2026.

Casey warned that rolling back Medicaid could cost people treatment for opioid abuse while cutting taxes for the wealthy. "That is obscene and outrageous," he said.

More than 700,000 Pennsylvanians have gained health coverage through the ACA's expansion of Medicaid, Gov. Wolf said, including about 125,000 who received treatment for substance abuse. In New Jersey more than 500,000 received coverage under the Medicaid provision.

Some Republicans also balked at plans that they worried could hurt Medicaid coverage in their home states. Others thought the GOP bills left too much of the old health law in place.

A similar struggle had played out in the House, where after weeks of gyrations a repeal plan was scuttled, only to be revived weeks later and passed, sending the thorny issue to the Senate.

The Senate moved one step closer Tuesday — even as the legislation remains clouded.