President Donald Trump lashed out at Republican leaders and groups on Sunday for the defeat of the bill to repeal and replace his predecessor's healthcare law, after blaming Democrats for the loss on Friday.

In a Twitter posting to his 27 million followers, Trump criticised the House Freedom Caucus, the conservative Heritage Foundation and the free-market advocacy group Club for Growth, which opposed the bill for not going far enough to erase Obamacare, the system implemented by Democrats under President Barack Obama.

"Democrats are smiling in D.C. that the Freedom Caucus, with the help of Club for Growth and Heritage, have saved Planned Parenthood & Ocare!" Trump said.

The criticism marked a shift for Trump, who had avoided blaming Republicans and House Speaker Paul Ryan for the defeat of the bill. House leaders abruptly scrapped a planned vote on repeal on Friday because not enough support materialised, largely due to the Freedom Caucus, made up of Congress's most rebellious conservative members.