WASHINGTON With Vice President Mike Pence breaking a 50-50 tie, the Senate voted by a hair Tuesday to start debating Republican legislation to tear down much of the Obama health care law.

The vote gives President Donald Trump and GOP leaders a crucial initial victory but launches a weeklong debate promising an uncertain final outcome.

The 51-50 vote kept alive hopes of delivering on promises that countless Republican candidates have campaigned on for years repealing President Barack Obama's 2010 health care overhaul.

It also averted what would have been a blistering defeat for a party divided between fervent conservatives demanding the evisceration of Obama's statute and centrists intent on not pulling coverage away from millions of Americans.

Utah Sens. Orrin Hatch and Mike Lee, both Republicans, voted in favor of starting debate.

Lee voted yes on a motion to proceed to debate on the American Health Care Act, continuing the fight to repeal Obamacare.

"We campaigned on repealing Obamacare for seven years," the senator said in a statement. "I hope my colleagues will honor their promise and vote with me for the 2015 repeal bill."

Pence presided over the Senate during the vote, which began after dozens of protesters shouted "Kill the bill" and "Shame" from the chamber's visitors gallery.

Enhancing the day's theatrics, one pivotal "yes" vote was cast by Sen. John McCain, R-Ariz., who flew to the Capitol just days after revealing he'd been diagnosed with brain cancer and was home considering the next steps in his treatment.

With Republicans wielding a narrow 52-48 majority, the 80-year-old's appearance let Senate Majority Leader Mitch McConnell, R-Ky., lose two GOP senators and still prevail wiggle room that would have shrunk to just one in McCain's absence.

McCain entered the chamber 29 minutes into the roll call to a standing ovation from members of both parties and visitors watching from above. Smiling, he exchanged embraces with McConnell, Senate Minority Leader Chuck Schumer, D-N.Y., and others, then cast his "yes" vote with two thumbs up.

Before the vote, McConnell declared, "We can't let this moment slip by," essentially lecturing GOP lawmakers to give their party's high-profile legislation a chance to move forward. "We can't let it slip by. We've been talking about it too long."

Moderate Sens. Susan Collins, R-Maine, and Lisa Murkowski, R-Alaska, were the only Republicans to defect from their party's quest. Their complaints about the legislation had included its cuts in Medicaid, the health insurance program for the poor, the disabled and nursing home residents.

Not a single Democrat backed the effort to overthrow Obama's signature domestic legislative achievement. In an unusual move, most of them sat in their states during the climactic roll call, eyeing Republicans as they cast their votes.

Technically, Tuesday's vote meant the Senate would consider a measure the House approved in May eliminating much of Obama's statute. Like legislation McConnell crafted mostly behind closed doors and has since revised it would eliminate Obama's tax penalties on people not buying policies, cut Medicaid, erase many of the law's tax boosts and provide less generous health care subsidies for consumers.

But now, the Senate faces 20 hours of debate and a long parade of amendments, and if a measure eventually emerges it is likely to look quite different. Because the chamber's moderates and conservatives are so riven over how to replace Obama's overhaul, leaders have discussed passing a narrow bill repealing only some unpopular parts of that law like its penalties on individuals who eschew coverage with the ultimate goal being to negotiate a final package with the House.

In the moments before the vote, most GOP critics of the legislation fell into line to allow debate to begin. They included conservative Sens. Lee, of Utah, Rand Paul, of Kentucky, plus moderates Rob Portman, of Ohio, and Shelley Moore Capitol, of West Virginia.

Paul said he was voting yes after McConnell told him the Senate would debate his proposal to scuttle much of Obama's law and give Congress two years to enact a replacement an amendment that seemed certain to lose.

Trump kept up the pressure on GOP lawmakers, tweeting, "After 7 years of talking, we will soon see whether or not Republicans are willing to step up to the plate!" He added: "ObamaCare is torturing the American People. The Democrats have fooled the people long enough. Repeal or Repeal Replace! I have pen in hand."

McConnell's bill would abolish much of Obama's law, eliminating its tax penalties on people not buying policies, cutting Medicaid, eliminating its tax boosts on medical companies and providing less generous health care subsidies for consumers. But at least a dozen GOP senators have openly said they oppose or criticized the measure, which McConnell has revised as he's hunted Republican support.

Besides allowing an early vote on Paul's repeal plan, moderates were seeking additional money for states that would be hurt by cuts in Medicaid, the health insurance program for the poor, the disabled and nursing home patients.

Conservatives wanted a vote on a proposal by Ted Cruz, R-Texas, letting insurers offer bare-bones policies with low premiums, which would be illegal under Obama's law.

With leaders still struggling to line up enough votes to approve a wide-ranging overhaul of Obama's law, there was talk of eventually trying to pass a narrow bill details still unclear so House-Senate bargainers could craft a compromise. That, too, was encountering problems.

"This idea that we're going to vote on something just to get in conference and then figure it out later is nuts," Sen. Lindsey Graham, R-S.C., told reporters.

Had Tuesday's vote failed, it would have been an unalloyed embarrassment for a party that finally gained control of the White House, Senate and House in January but still fell flat on its promise to uproot Obamacare. Republicans could try returning to the bill later this year if they somehow round up more support.

Obama's law was enacted in 2010 over unanimous Republican opposition. Since then, its expansion of Medicaid and creation of federal insurance marketplaces has produced 20 million fewer uninsured people. It's also provided protections that require insurers to provide robust coverage to all, cap consumers' annual and lifetime expenditures and ensure that people with serious medical conditions pay the same premiums as the healthy.

The law has been unpopular with GOP voters, and the party has launched numerous attempts to dismantle the statute. All until this year were mere aspirations because Obama vetoed every major one that reached him.

Ever since 2010, Republicans have been largely united on scuttling the statute but divided over how to replace it.

Those divides sharpened with Trump willing to sign legislation and estimates by the nonpartisan Congressional Budget Office that several GOP bills would cause more than 20 million people to become uninsured by 2026. Polls showing growing popularity for Obama's law and abysmal approval ratings for the GOP effort haven't helped.