U.S. President Donald Trump (2nd L), House Speaker Paul Ryan (R-WI) (L). Alex Wong/Getty Images GOP leadership pulled its bill to overhaul the US healthcare system from what looked almost certain to be a failed floor vote in the House on Friday, in a blow to President Donald Trump's agenda and House Speaker Paul Ryan's leadership of his caucus.

It was pulled after it became clear that Republicans did not have enough votes to pass the American Health Care Act, their bill to repeal and replace Obamacare, the law formally known as the Affordable Care Act.

In a last-minute effort on Friday, Republican leaders attempted to wrangle the needed votes to pass the bill after delaying the vote on Thursday.

But around 3 p.m., Ryan told Trump that he did not have the votes. The president asked him to pull the bill from the floor, a House GOP leadership aide told Business Insider. The vote had been expected at 3:30 p.m.

Trump told The Washington Post's Robert Costa, "I don't blame Paul." Trump had said earlier in the day that Ryan should keep his job if the bill were to fail. Trump also told Costa that the bill would not be readdressed anytime soon.

The New York Times' Maggie Haberman also reported that Trump told her healthcare was now the Democrats' problem and that he thought they would be ready to negotiate when Obamacare failed.

In a press conference after the bill was pulled, Ryan said Republicans "came up short" and called it a "disappointing day."

Democrats cheered the failure of the bill, saying it was good news for people who were projected to lose their insurance if the bill were to become law.

"Today is a great day for our country," said House Minority Leader Nancy Pelosi. "What happened on the floor is a victory for the American people."

Senate Minority Leader Chuck Schumer ascribed the failure to the president.

"So much for the Art of the Deal," he said in a statement, referring to Trump's famous business book.

"Ultimately, the Trumpcare bill failed because of two traits that have plagued the Trump presidency since he took office: incompetence and broken promises," Schumer said. "In my life, I have never seen an administration as incompetent as the one occupying the White House today."

House GOP leadership had faced opposition from both hardline conservatives and moderates, making the bill's passage untenable.

Republican leaders appeared to concede on Thursday that they did not have the votes necessary to pass the bill. But Trump pushed for a vote, even issuing an ultimatum to House Republicans on Thursday night. Trump, via a message delivered by Office of Management and Budget Director Mick Mulvaney, said he would move onto other priorities if the caucus failed to pass the bill. The gambit did not appear to persuade many to change their votes.

Conservatives in the House Freedom Caucus had said that the AHCA did not go far enough in its repeal of Obamacare because it kept some of the law's more popular elements. Moderates, on the other hand, had said the AHCA did not fix the problems of Obamacare and that repealing the law's so-called essential health benefits — a demand of the Freedom Caucus — would harm insurers.

Republican leaders were ultimately unable to bridge the gap between the two sides.

The failure of the bill is a blow to both Ryan and Trump, setting back their ambitious political agenda despite the GOP's control of the presidency and both houses of Congress.

For Ryan, it represented a failure of the GOP to use its largest majority in the House since the 1920s to its advantage. Ryan told reporters on March 7 that "when this thing comes to the floor, we'll have 218" votes.

For Trump, it served as the first major legislative setback in his young presidency. Trump had promised during his campaign to repeal and replace Obamacare on "Day One," and he said shortly before his inauguration that he wanted the job done within weeks.

Ryan and Trump will likely regroup to work on the rest of their agenda, including tax reform and Trump's budget.