A vote on US President Donald Trump's "Obamacare" repeal bill has been withdrawn at the last minute after it failed to gain enough support to pass in Congress.

The President and Republican leaders agreed to pull the vote on Friday after it became apparent it would not get enough votes.

The withdrawal is seen as a major defeat for Mr Trump. Replacing the health programme - set in place by former US president Barack Obama - was one of Mr Trump's election pledges

Mr Trump had demanded House Republicans vote on the legislation on Friday, threatening to leave "Obamacare" in place and move on to other issues if the vote failed. The bill was withdrawn minutes before the vote was due to take place.

The president's gamble failed. Instead, Mr Trump saw his ultimatum rejected by Republican lawmakers who made clear they answer to their own voters, not to the president.

Republicans have spent seven years campaigning against the former president's health care law, and cast dozens of votes to repeal it in full or in part.

But when they finally got the chance to pass a repeal bill that actually had a chance to get signed, they could not pull it off.

Mr Trump is certain to be weakened politically - with a big early congressional defeat adding to the continuing inquiries into his presidential campaign's Russia connections and his unfounded wiretapping allegations against Mr Obama.

The development came on the afternoon of a day when the bill, which had been delayed a day earlier, was supposed to come to a vote.

But instead of picking up support as Friday wore on, the bill went the other direction, with some key lawmakers coming out in opposition.

Congressman Rodney Frelinghuysen of New Jersey, chairman of a major committee, Appropriations, said the bill would raise costs unacceptably on his constituents.

Republican Barbara Comstock of Virginia, a key moderate Republican, and Republican David Joyce of Ohio also announced "no" votes.

The defections raised the possibility that the bill would fail. In the face of that evidence, and despite insistences from White House officials and House Speaker Paul Ryan that Friday was the day to vote, leadership pulled back from the brink.

The bill would have eliminated the Obama statute's unpopular fines on people who do not obtain coverage and would also have removed the often-generous subsidies for those who purchase insurance.

Republican tax credits would have been based on age, not income like Obama's, and the tax boosts Obama imposed on higher-earning people and health care companies would have been repealed.

The bill would have ended Obama's Medicaid expansion and trimmed future federal financing for the federal-state program, letting states impose work requirements on some of the 70 million beneficiaries.

The non-partisan Congressional Budget Office said the Republican bill would have resulted in 24 million additional uninsured people in a decade and lead to higher out-of-pocket medical costs for many lower-income and people just shy of age 65 when they would become eligible for Medicare. The bill would have blocked federal payments for a year to Planned Parenthood.

Democrats were uniformly opposed. "This bill is pure greed, and real people will suffer and die from it," said Republican Pramila Jayapal of Washington state.

Mr Trump said his healthcare reform fell short because it lacked support from Democrats.

Trump made his first comments about the failure of a signature legislative item on Friday in the Oval Office a short time after a House vote on the bill was withdrawn.

Mr Trump told reporters "we were very close" and tried to blame Democrats, through Republicans control both the House and the Senate.

He also predicted the Affordable Care Act would soon implode, forcing Democrats to join the Republicans at the negotiating table.