US Vice President Mike Pence had to break a 50-50 tie as the Senate voted by a hair to start debating Republican legislation to tear down much of the Obama healthcare law.
The vote gives President Donald Trump and Republican leaders a crucial initial victory but launches a week-long 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 healthcare overhaul.
It also averted what would have been a blistering defeat for a party divided between fervent conservatives demanding the evisceration of Mr Obama's statute and centrists intent on not pulling coverage away from millions of Americans.
Mr 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.
One pivotal "Yes" vote was cast by Senator John McCain, who flew to the Capitol just days after revealing he had 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 lose two Republican senators and still prevail - wriggle room that would have shrunk to just one in Mr McCain's absence.
Mr 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 Mr McConnell, Senate Minority Leader Chuck Schumer and others, then cast his "Yes" vote with two thumbs up.
Before the vote, Mr McConnell declared "We can't let this moment slip by," essentially lecturing Republican politicians 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 Senators Susan Collins and Lisa Murkowski 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 programme for the poor, the disabled and nursing home residents.
Not a single Democrat backed the effort to overthrow Mr 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 Mr Obama's statute.
Like legislation Mr McConnell crafted mostly behind closed doors - and has since revised - it would eliminate Mr Obama's tax penalties on people not buying policies, cut Medicaid, erase many of the law's tax boosts and provide less generous healthcare 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 divided over how to replace Mr Obama's overhaul, leaders have discussed passing a narrow bill repealing only some unpopular parts of that law - such as its penalties on individuals who eschew coverage - with the ultimate goal being to negotiate a final package with the House.