Republicans in the US House of Representatives, short of support from their own party, have withdrawn a healthcare bill drafted to repeal and replace "Obamacare".

House Speaker Paul Ryan said he recommended that it be withdrawn because he did not have the votes to pass it, and President Donald Trump agreed.

Just a day earlier, Trump had demanded a House vote and said if the measure lost, he would move on to other issues.

Trump told reporters in the Oval Office that "we were very close" and tried to blame Democrats for the failure to pass the legislation - even though his Republican Party controls both the House and the Senate.

"We were just probably anywhere from 10 to 15 votes short," Trump said. "With no Democrat support, we couldn't quite get there."

He also said he was surprised and disappointed by the opposition from the House Freedom Caucus, a group of conservative Republicans who led the resistance against the legislation.

Ryan told reporters that Obamacare will now stay in place for the foreseeable future.

Pulling the bill he had promoted was "a setback, no two ways about it," he said, calling it a "disappointing day".

Democrats, on the other hand, called it a "victory" for the American people.

READ MORE: Americans split over replacing Obamacare

Scrapping former president Barack Obama's healthcare law was one of Trump's major campaign promises.

The failure to get the bill approved called into question his ability to get other key parts of his agenda, including tax cuts and a boost in infrastructure spending, through Congress.

Public policy professor Bill Schneider said that during the president's first 100 days, his impact is supposed to be at its peak.

"Here, the president was handed a huge setback, by his own party, which was also committed to repealing Obamacare," he told Al Jazeera.

"Trump is defeated and he learned something: you cannot deal with members of Congress as if they were building contractors ... He said if you don't give me what I want, I'll walk out. Maybe that works with building contractors, but it doesn't work with politicians, each of whom has his or her own constituency."

Conservatives had condemned the Republican-drafted bill because it would scrap Obamacare, but put another government plan in its place. They believe healthcare should be left to the free market.

Democrats and moderate Republicans, meanwhile, feared the withdrawn bill would take insurance away from millions of people.

"What happened on the floor is a victory for the American people," Nancy Pelosi, leader of the minority Democrats in the House, said.

She said the message became "very clear" to Republicans that people across the country still support Obamacare.

A Quinnipiac University poll indicated only 17 percent of Americans support the Republican plan known as the American Health Care Act (AHCA).

READ MORE: The Obamacare debate is not just about healthcare

Now that the effort to overhaul the nation's healthcare system has collapsed, Trump and Treasury Secretary Steven Mnuchin said the administration will focus on gaining congressional approval for a sweeping tax overhaul plan.

"I would say that we will probably start going very, very strongly for the big tax cuts and tax reform. That will be next," Trump said.

Mnuchin said a bill would soon be introduced to cut both individual and corporate taxes.

Obama signed the Affordable Care Act, widely known as Obamacare, in 2010, providing health coverage for 20 million low-income Americans previously uninsured. Many middle-earners complained their premiums spiked as a result.

Millions of Americans would have lost coverage next year under the Republican plan, according to a review by the Congressional Budget Office.

It would have rescinded a range of taxes created by Obamacare, ended Obamacare's income-based subsidies to help people buy insurance, and ended the expansion of the Medicaid programme for the poor, among other changes.