So much for the hard-bargaining American president's ultimatum on repealing Obamacare.

Donald Trump's first major legislative push veered into a ditch on Friday, denting his image as a master negotiator and dealing an embarrassing blow to his young presidency's momentum.

Facing near certain defeat in a House vote, Trump on Friday ordered Republicans to pull the health-care bill he pitched as the take-it-or-leave-it conservative replacement for the Affordable Care Act, also known as Obamacare.

It was a stunning act of surrender from the billionaire business magnate turned commander-in-chief, who prides himself for his deal-making acumen.

But the death of the Trump administration's American Health Care Act was even more stunning given who ultimately spurned him at the bargaining table: His own Republicans, who for the first time in 10 years finally have control of both chambers of Congress as well as the Oval Office.

"It's hard to make this look pretty," says Steve Billet, director of the master's in legislative affairs program at George Washington University.

"When you control all the levers of government, you've got to deliver something."

Trump's bluff called

Withdrawing the bill altogether at least avoided a recorded defeat on the House floor. The Republicans never had the 218 votes needed to win passage in the House anyway. After postponing the vote by a day to Friday, Trump delivered a stern ultimatum.

Like it or not, lawmakers were warned that a roll call was imminent. They could either stand with him to support the American Health Care Act, or slink back to their constituents to explain why they couldn't bring themselves to help eliminate Obamacare.

House Speaker Paul Ryan withdrew the legislation after Trump called him and asked him to halt debate without a vote, according to a Ryan spokesperson. (Jonathan Ernst/Reuters)

The hardball tactic might have worked — if conservatives hadn't called his bluff. With no promised roll call after all, Obamacare survives as the law of the land, Republican House Speaker Paul Ryan acknowledged ruefully in a news conference.

"We're going to be living with Obamacare for the foreseeable future."

The setback for repeal proponents wasn't for lack of trying. It certainly wasn't for lack of time, either, with a full seven years to devise a conservative-approved alternative to Obamacare.

"But this thing turned out to be a big loser," Billet says of the AHCA. "And the last thing Trump wants to be portrayed as, is a loser."

Hardline conservatives in the Freedom Caucus couldn't get on board with the bill, reasoning it didn't do enough to lower insurance premiums. Trump capitulated on Thursday, offering a major concession — to roll back the "essential health benefits" provision under Obamacare that guarantees insurance companies cover services such as maternity, mental health and prescription drugs. That only caused moderate Republicans to threaten to back off.

'This is our moment'

In the years before a Republican president came into power, the House voted nearly 60 times to repeal or alter Obamacare. Never until this time has there been a president willing to sign that bill and pass it, White House press secretary Sean Spicer reminded reporters Friday, hours before the bill was pulled.

"This is our moment; this is our opportunity to do this," Spicer said.

Yet the discord within the party proved too much, even to fulfil the central Republican wish to overhaul health care. With ideologues emboldened by their ability to defy the president, Billet says the tone is set for Trump's agenda ahead, and it looks to be in trouble.

The repeal-and-replace setback threatens to trigger a pileup of other failed legislative pushes, he warns, particularly on issues shown to have even weaker party alignment.

Trump still wants reforms on taxation and on immigration, and it's expected he'll introduce a $1-trillion infrastructure spending package. Meanwhile, Republicans who have long supported free trade are showing resistance to the president's anti-trade agenda.

"I don't think any of these things will fall by the wayside, but they will certainly be harder to pass," Billet says.

An awkward beginning

In a closed-door meeting last week, Iowa representative Steve King said Trump himself made an urgent appeal to lawmakers, hinting that failure to close the deal on repeal would jeopardize a host of coveted Republican goals. If a unified Congress and White House can't even come together on eliminating something as despised by conservatives as Obamacare, then just what can they accomplish together?

"He was basically saying this is bad for the whole Republican agenda," King told NPR News. "If we don't make it on this one, which we spoke about so much, then it hurts us on everything going forward."

Humbling as Friday's health-care defeat may have been for Trump, it might not have been so bad had it not been his first legislative priority. According to the New York Times, Trump conceded in private conversations that he regrets letting Ryan convince him to try his hand at tackling Obamacare before unveiling a plan to cut taxes.

People march in a 'Save Obamacare' rally on the seventh anniversary of Obamacare's signing, in Los Angeles on March 23. (Lucy Nicholson/Reuters)

It struck congressional expert Josh Huder as a miscalculation. Untangling health care is an unwieldy and complex matter that affects a big chunk of the GDP.

"If this was [Trump's] first test, I mean, it's like taking the final at the very beginning of the year," said Huder, a senior fellow at the Government Affairs Institute at Georgetown University. "It's not often you try to restructure 16 per cent of the entire U.S. economy two months into a new administration."

As Republicans continued dithering last month, Trump infamously remarked that "nobody knew that health care could be so complicated," a comment that launched a thousand snarky responses.

'The dog that caught the car'

Jonathan Gruber, the MIT economics professor who helped craft the original Affordable Care Act legislation, had an idea how complicated it could be.

"To me, the Republicans are like the dog that caught the car. They realize the car is going fast and it's pretty heavy; but now they don't know what to do with it," Gruber says. "It turns out Obamacare was a carefully crafted compromise between a lot of competing interests in a way to create a balanced system."

John McDonough, another Obamacare architect now teaching health policy at Harvard University, was heartened by Friday's outcome, seeing it as an affirmation by Americans of a universal right to health care. Overhauling the system is no simple feat.

"If it weren't hard and complicated, it would have been done a long time ago."

Trump blames the Democrats

As for Trump, he blamed Democrats for refusing to back him. While some finger-pointing was expected, Billet was adamant: "This was a failure on the part of the Republican Party. They control the White House, they control the House, they control the Senate. For them to try to lay this at the feet of the Democrats is ridiculous," he says.

With a new poll showing Trump's approval ratings at 37 per cent, Billet wonders whether House Republicans seeking re-election in the 2018 midterms may begin to rethink how much cachet there is to being aligned with the president.

"What does this mean for the wall with Mexico? Should we be pumping billions into that?" Billet says. "I might ask myself those things if I feel my constituents are thinking, maybe we shouldn't be tracking the Trump agenda so closely."