The latest attempt to repeal the Obama-era healthcare act has failed after a dramatic night in the US Senate.
At least three Republicans – John McCain, Susan Collins and Lisa Murkowski – voted against the bill, which needed a simple majority to pass.
It was voted down by 51 votes to 49.
The so-called “skinny” repeal, which would have scaled back some of the more controversial provisions, is the third failed attempt to repeal Obamacare.
Senate Majority Leader Mitch McConnell, a Republican, described it as a “disappointing moment”.
The vote had been delayed after Senate Republicans kept a procedural vote open before the actual Obamacare vote while they attempted to persuade their members to vote for the repeal.
It would have resulted in 16 million people losing their health insurance by 2026, with insurance premiums increasing by 20%, according to the Congressional Budget Office (CBO).
A dagger in Trump’s plans – BBC North America Correspondent Anthony Zurcher
The arc of history is long, but it bends towards revenge.
Just over two years after candidate Donald Trump mocked John McCain’s Vietnam War record, noting that he prefers heroes “who weren’t captured”, the Arizona senator stuck a dagger in President Trump’s healthcare reform plans.
There were gasps when Mr McCain, after being furiously lobbied by Vice-President Mike Pence, joined two other Republican senators in voting against the so-called “skinny” repeal plan, considered the bare minimum Senate Republicans could agree on.
Instead of a big step toward becoming law – either in its skinny form or after further negotiations with the House of Representatives – the future of Obamacare repeal has been thrown into doubt.
The reality is, for now, there is no minimum level of change on which Senate Republicans can agree. They either have to work with Democrats or resign themselves to stalemate and move on to other topics, like taxes or infrastructure spending.
It will take some time for the enormity of this late-night Senate drama to sink in. No one really expected Mr McCain to be the decisive vote, but the man who once had a reputation as a Republican “maverick”, now facing a dire brain cancer diagnosis, had at least one more surprise in his pocket.
Vice President Mike Pence was seen talking to Mr McCain for more than 20 minutes.
But Mr McCain then approached a group of Democrats, who appeared happy to see him.
The Trump administration had also put pressure on Sen Murkowski, with President Trump tweeting on Wednesday that she had “let the Republicans, and our country, down”.
Ahead of Thursday’s late-night vote, Mr Trump had urged Republicans to “get there after waiting seven years” and “give America great healthcare”.
The “skinny” repeal plan would have eliminated parts of Obamacare – the Affordable Care Act – including the individual mandate requiring all Americans to have health insurance coverage, as well as a tax on medical devices.
But the repeal bill’s failure means Obamacare remains in force.