House Speaker Paul Ryan | Shawn Thew/EPA White House launches damage control after health bill collapses ‘This is 100 percent a Ryan failure,’ one senior administration official said after the Obamacare repeal bill was pulled on Friday.

President Donald Trump did “everything” he could to repeal and replace Obamacare, the White House said again and again on Friday.

Apparently everything was not enough.

Damage control was underway at the White House even before the Obamacare repeal bill was pulled from the House floor Friday afternoon, an effective waving of the white flag on one of Republicans’ top priorities. And as the White House sought to prevent any blame from landing on Trump, House Speaker Paul Ryan emerged as a prime target.

Press secretary Sean Spicer, who on Thursday expressed complete confidence in the bill’s passage, sounded a different tune early Friday afternoon, as Ryan huddled at the White House with Trump to discuss a way forward hours before the decision was made to call off the vote.

“The president has been working the phones and having in-person meetings since the American Health Care Act was introduced,” Spicer said. “He’s left everything on the field when it comes to this bill.”

And even while Spicer said Ryan, too, had done his best, others in the White House were ready to see the conservative speaker take the blame for the humiliating defeat.

“Paul really worked hard,” Trump said, but was also quick to tout his own efforts.

“This is 100 percent a Ryan failure. His plan and Tom Price is his guy,” one senior administration official said after the bill was pulled.

Others in the White House sought to downplay any signs of Trump-Ryan tension, saying the White House merely underestimated the animosity between factions within the Republican conference, specifically the hardline Freedom Caucus and moderate Tuesday Group.

“Trump feels like Ryan did everything right,” one senior administration official said. “He has no ax to grind with Paul Ryan. … He’s ready to move on to other things.”

Speaking to reporters in the Oval Office, Trump hewed to a message, saying the failure was the fault of the Democrats, an odd claim given the Republicans control Congress. He thanked Ryan for his work, and said he remained confident in Ryan’s ability to lead the House.

“Paul really worked hard,” Trump said, but was also quick to tout his own efforts.

“I worked as a team player,” he said.

And he added that he did not consider the bill perfect.

"Well I think we could have had things that I would have liked more, and if we had bipartisan [support], I really think we could have a health care bill that would be the ultimate,” he said.

When asked if he felt “betrayed” by the Freedom Caucus, Trump responded: "No, I'm not betrayed. They're friends of mine. I'm disappointed because we could have had it, so I'm disappointed. I'm a little surprised, to be honest with you. We really had it. It was pretty much there within grasp. But I'll tell you what is going to come out of it is a better bill.”

Ryan, meanwhile, was striking a different note on Capitol Hill, making clear he saw the Freedom Caucus as responsible for the defeat.

"There is a bloc of 'no' votes that we had that is why this didn't pass. They were a sufficient number of votes that prevented it from passing and they didn't change their votes. We were close," Ryan said.

But Ryan was full of public praise for Trump and his team.

"He did everything he possibly could to help people see the opportunity that we have with this bill. He's really been fantastic. Still, we gotta do better and we will,” Ryan said.

“This is a setback, no two ways about it,” he admitted.

The White House, even before the bill was pulled, was laser-focused on protecting Trump. “The president has given it his all,” Spicer declared at one point during the briefing on Friday.

“The president is confident that we have done every single thing possible,” Spicer said at another.

“We are confident that we have done everything,” Spicer added later. “We’ve done everything. We’ve done every single thing. Every meeting, every call, every discussion.”

And he repeated a line he had deployed Thursday, when asked if Trump would take responsibility if the bill failed: “You can’t force people to vote.”

The collapse of the bill has cast a pall on Trump’s young presidency and raised fresh doubts about the outsider president’s ability to manage a raucous Republican Congress to fulfill his grand campaign promises — and there has been no bigger promise from Trump and his fellow Republicans than to repeal and replace Barack Obama’s signature legislative achievement.

It also raises new questions about the fate of Ryan, who did little to campaign for Trump in the fall and now is seen by some as responsible for the White House’s first major defeat.

Even before the fate of the bill became clear, former House Speaker Newt Gingrich, a vocal Trump ally, slammed the House Republican leadership for the debacle.

“I don’t understand how the leadership got to the point where they [designed] a bill that didn’t have the votes,” Gingrich said in an interview. “I don’t understand artificial deadlines that lead to defeat.”

The rush to pass the bill — with less than three weeks from unveiling to a scheduled floor vote — was mystifying to the former speaker, who said he would never bring a bill to the floor as many votes short as AHCA appeared. And on an issue like health care in particular, Gingrich said, such a rush made no sense.

“Nancy Pelosi brought Obamacare to the floor in July, Obama signed it in March. That’s eight months,” Gingrich said. “The power to schedule is entirely controlled by the speaker.”

Gingrich’s advice: “Pull it.”

That advice was followed late Friday afternoon.

Ryan returned the favor, saying at a news conference Friday afternoon that Trump "gave his all.”

The White House’s messaging, so far, appears to be meeting with some success in deflecting potential blame from the White House.

The conservative advocacy group, Heritage Action, has been among the most vocal critics of the repeal plan, and targeted its fire at Ryan.

The group has pointed to Ryan’s own words to attack him, noting that Ryan’s “Better Way” agenda called for the Affordable Care Act to be “fully repealed.” The AHCA, many conservatives argued, fell far short of full repeal and kept too many of the law’s signature elements, like tax credits to help low-income people buy insurance and requirements to protect those with pre-existing conditions.

Spicer declined to attack the speaker Friday. He blamed the arcana of congressional procedure as much as campaign promises for opting to kick off the presidency with an assault on the Affordable Care Act.

“I’m not assigning blame,” Spicer said at one point during Friday’s briefing.

Ryan returned the favor, saying at a news conference Friday afternoon that Trump "gave his all.”

House leadership also privately blamed moderate Republicans, who defected en masse late in the week, for sinking the bill. Many pulled out after the White House struck a deal with the Freedom Caucus to remove the requirement that insurers provide certain “essential” coverage, like maternity care, ambulatory care and lab work.

"A lot of blame should also fall on Northeast moderates," a GOP leadership source said.

"He was never willing to build consensus because he was so personally invested in his own bill" — Senior Republican source on Paul Ryan

But a senior Republican source put the blame squarely on Ryan.

"He was never willing to build consensus because he was so personally invested in his own bill," the source griped.

The Freedom Caucus, for their part, blamed Ryan, too, for the failure.

Some members felt Ryan had misled the president about the bill’s chance of passage and did not do enough to seek a consensus.

At his briefing, Spicer also struck a tone of resignation as he declared the burden was on House Republicans to fulfill their long-held pledge to scrap Obamacare.

"It is now up to members," Spicer said. "It is ultimately them that have to go down on the floor and cast that vote.”

Less than two hours later, the bill was pulled.

Madeline Conway contributed to this report.