Donald Trump had heard enough about policy and process. It was Thursday afternoon and members of the House Freedom Caucus were peppering the president with wonkish concerns about the American Health Care Act—the language that would leave Obamacare’s “essential health benefits” in place, the community rating provision that limited what insurers could charge certain patients, and whether the next two steps of Speaker Paul Ryan’s master plan were even feasible—when Trump decided to cut them off.

"Forget about the little shit," Trump said, according to multiple sources in the room. "Let's focus on the big picture here."

The group of roughly 30 House conservatives, gathered around a mammoth, oval-shaped conference table in the Cabinet Room of the White House, exchanged disapproving looks. Trump wanted to emphasize the political ramifications of the bill's defeat; specifically, he said, it would derail his first-term agenda and imperil his prospects for reelection in 2020. The lawmakers nodded and said they understood. And yet they were disturbed by his dismissiveness. For many of the members, the "little shit" meant the policy details that could make or break their support for the bill—and have far-reaching implications for their constituents and the country.

"We’re talking about one-fifth of our economy," a member told me afterward.

Ultimately, the meeting failed to move any votes. Two Freedom Caucus members—Brian Babin and Ted Poe, both of Texas—told the president that they had switched to yes, but their decisions had already been registered with White House vote-counters prior to sitting down with Trump. (Their colleagues didn't appreciate the gesture, feeling that Babin and Poe were trying to score points with the president at their expense.) Upon returning to Capitol Hill, the Freedom Caucus gathered in a meeting room inside the Rayburn office building, discussed Trump's admonitions to them and took another vote. The tally had not changed: Of the group’s roughly three dozen members, two-thirds remained opposed, with only five or six of those saying they were "soft" in that stance.

The president had been working on many of them individually in recent days, typically with what members described as "colorful" phone calls, littered with exaggerations and foul language and hilariously off-topic anecdotes. In some cases, the pressure worked. Jim Bridenstine, a Freedom Caucus member and longtime problem for the Republican leadership, agreed to back the bill after conversations with Trump and other administration officials. (It wasn't necessary to remind Bridenstine that he was a leading candidate to become NASA administrator, and would likely hurt his chances by voting against the president.)

But by and large, Trump's first attempt to corral the Republican-controlled Congress—and particularly the Freedom Caucus, a rambunctious, ideologically charged collection of GOP legislators who have long refused to fall in line behind the party's leadership—failed miserably. That failure played a major role in the collapse of the American Health Care Act almost exactly 24 hours after their meeting at the White House, and now, as Trump warned, threatens to paralyze the president's first-year policy agenda and send Republicans into a damaging cycle of intra-party recrimination.

There will be sufficient blame to go around in the days ahead, and indeed, some Trump loyalists are already pointing the finger at Ryan and his leadership team. The speaker, without question, was clumsy in his strategic rollout and far too presumptuous about the legislation's infallibility. But for a president who pledged to break through the gridlock in Washington—and who promoted himself as a peerless dealmaker—the defeat of Trump's first major policy initiative undermines his take-charge image and emboldens his enemies in both parties.

Tom Price, the new Health and Human Services secretary who previously served 12 years in Congress, had assured nervous allies recently that the difference between Ryan's speakership and that of Speaker John Boehner—who was driven from office by the intransigence of the Freedom Caucus—was that unlike his predecessor, Ryan had the backing of a strong Republican president. Mick Mulvaney, Trump's budget director and a former Freedom Caucus member himself, made similar arguments. But faced with his first major test, the president failed—on multiple occasions and on many levels.

For starters, Trump kept the GOP health care bill at arm's length for more than a week, offering a smattering of favorable remarks but failing to embrace it in convincing fashion. Ryan's rivals on Capitol Hill got the message: The president was lukewarm about the legislation. According to interviews with officials in all three camps—the White House, the Republican leadership and the Freedom Caucus—conservatives saw a schism between Trump and Ryan, and seized on the perceived opening.

Early last week, during a budgetary meeting at the White House, the two leaders of the Freedom Caucus—chairman Mark Meadows and former chairman Jim Jordan—kept diverting the discussion to health care, much to the annoyance of Budget Committee chairwoman Diane Black. When the meeting broke, Meadows and Jordan swiftly sought an audience with the president to discuss Ryan's bill. Trump granted them the meeting, during which the conservatives complained that Ryan was presenting them with a "binary choice"—either vote for the bill that had been introduced, or vote to preserve Obamacare—that was doing the president a disservice. Trump replied that he was open to negotiation and new ideas, and Meadows and Jordan left the White House thinking they had a powerful ally. Ryan’s team was less than thrilled at the narrative of a good cop, bad cop routine.

Things went downhill quickly from there. After Meadows visited Trump at Mar-a-Lago, the president’s Florida retreat, that weekend to push for conservative changes—capping a week of futile discussions about significantly altering the House bill—Freedom Caucus members were eager to hear from Trump on Tuesday when he arrived at the Capitol. But when he rose to address the GOP conference, the president made it clear there would be no further modifications, and said he expected Republicans to rally around Ryan's bill.

Then Trump made a mistake. After singling out Meadows and asking him to stand up in front of his colleagues, Trump joked that he might "come after" the Freedom Caucus boss if he didn't vote yes, and then added, with a more serious tone: "I think Mark Meadows will get on board."

It was a crucial misreading of Meadows, who has been determined to please both the White House and his conservatives colleagues on the Hill. Upon assuming the chairmanship of the Freedom Caucus earlier this year, Meadows was viewed suspiciously by some of his members who worried that the North Carolina congressman is too cozy with Trump and would hesitate to defy him. Meadows campaigned extensively with Trump last fall and struck up a relationship with White House chief strategist Steve Bannon, who communicates with him almost daily by text. Meadows knew the health care fight would be viewed as a test of his independence from Trump, and the moment the president called him out, he was boxed in.

"That was the biggest mistake the president could have made," one Freedom Caucus member told me. "Mark desperately wanted to get to yes, and Trump made it impossible for him. If he flipped after that he would look incredibly weak."

That was the biggest mistake the president could have made. Mark desperately wanted to get to yes, and Trump made it impossible for him.”

Disappointed with the episode, and with the president's apparent inflexibility, Meadows and other Freedom Caucus members back-channeled with the administration and landed what they thought was an invitation to the White House on Wednesday morning. They hoped for a meeting with Trump and an opportunity to negotiate some major policy changes directly with him. Instead, they found themselves hauled into the less-than-inspiring Executive Office Building for a pep rally with Vice President Mike Pence, chief of staff Reince Priebus, Bannon, and other members of Trump's inner circle—but not the president himself. (As an aside, it’s impossible to ignore the failure of Pence, Price and Mulvaney, three former conservative darlings while in the Congress, to sell more of their ideological brethren on this bill.)

Members of the Freedom Caucus realized right away that there would be no negotiating. Pence tried to pump up the conservatives, telling them the fight was theirs to win and that they needed to help Trump and Ryan score a victory for the new administration. The plea landed on deaf ears. "Take one for the team" was a phrase repeatedly deployed; at one point, after Bannon used it, Joe Barton, a white-haired conservative from Texas, snapped back in response that Bannon was talking to them like children and he didn't appreciate it. The room filled with uncomfortable silence; Bannon backed down and the meeting went on. (Barton eventually announced his support for the legislation—one of only a few who would eventually switch positions.) After several hours, the members returned to the Capitol feeling frustrated, calling the meeting "a waste of time" and wondering if they had missed their only window for cutting a deal with Trump.

That night, however, allies in the White House sent word to the Freedom Caucus that one thing they wanted—reforms to the “essential health benefits” provision under Title I of the Affordable Care Act—could be done. Excitement spread in the group, but there was also confusion; some members felt that would be a big enough concession to win their vote, while others felt it was only a step in the right direction. As they sought to clarify their internal disagreements, there was another meeting scheduled for the next morning, Thursday—this one at the White House and with the president himself.

Filled with hope once again, Freedom Caucus members were once again promptly disappointed. This meeting was yet another "take one for the team" seminar. The atmosphere was friendly, and the president had the group laughing with irrelevant riffs and stories of negotiations past, but it became clear, as soon as he made the "little shit" comment, that no serious changes were going to be made, because the president didn't have sufficient command of the policy details to negotiate what would or would not be realistic for Ryan to shepherd through the House.

Through charm, force of personality and sheer intimidation, Trump did move some votes into the yes column. But GOP leaders were left wondering why he didn't do more—why he didn't send tweets, travel to congressional districts, put his famed dealmaking skills to work. The answer, to Republicans on both ends of Pennsylvania Avenue, is obvious: Because he lacked familiarity with the legislation itself, and thought it was Ryan’s job to sell the specifics.

“Trump is a business executive. When he tells his lieutenants to get something done, he's used to it getting done,” one senior House GOP aide told me. “He’s really not used to getting involved himself.”

* * *

If the bill failed because Trump is a great salesman with a poor grasp of policy, it also failed because Ryan is a poor salesman with a great grasp of policy.

The speaker has spent decades straddling the worlds of politics and policy, and is infinitely more comfortable operating in the latter. He has dozens of friends around town in the constellation of conservative think tanks, lobby shops, activist groups and media outlets. Knowing that health care was batting leadoff for the new, unified Republican government, it would seem a no-brainer for the speaker to spend a few days, if not a few weeks, meeting with leading voices on the right to introduce the American Health Care Act, answer their questions, accept their criticisms and, most important, preempt any attacks on the legislation itself. After all, as Democrats love to point out, Ryan had seven years to plan for this moment—first as Budget chairman, then as Ways and Means chairman, then as speaker—and if anyone on the right was ready, it ought to have been him.

But Ryan didn’t feel such preventative measures were necessary. After days of drafting the bill in secretive locations at the Capitol—and Sen. Rand Paul, a hard-core Obamacare critic, exposing the absurdity by bringing reporters along as he hunted door-to-door for a copy—the text was leaked, and then unceremoniously released, without any clearly coordinated media strategy between the speaker's office and the White House. Conservatives around Washington, including some of Ryan’s longtime friends, were stunned. “The bill has had the worst rollout of any major piece of legislation in memory,” Rich Lowry, editor of National Review and a longtime Ryan ally, wrote in his Politico Magazine column on March 15.

Back in 2013, when the so-called Gang of Eight had authored its comprehensive immigration reform bill, Sen. Marco Rubio spent weeks making the rounds and meeting with top influencers on the right, taking unlimited time to answer every question and consider every criticism. He talked to journalists, grassroots leaders and academics; he offered himself as a human sacrifice to every prominent voice in conservative talk radio, attempting to neutralize opposition to the bill before it materialized. It never became law, but Rubio did everything he could. It passed the Senate, at least, before dying a quick death in the House—and that was in large measure thanks to having a media-savvy Tea Party darling take the lead and work conservative journalists and opinion leaders.

There was no such effort on Ryan’s part, and it showed. (Several allies argued he had done some outreach, but they failed to provide any specific examples.) After he unveiled the bill, leading health care experts on the right like Yuval Levin and Avik Roy trashed it as a poorly conceived mess; conservative pressure groups and their media allies immediately branded it as “Obamacare Lite.” Only then did Ryan move aggressively to mitigate the damage. He convened a group of conservative journalists in his office in mid-March and his team began tracking, and publicizing, every media appearance he made, especially promoting his interviews with conservative critics such as Sean Hannity and Laura Ingraham. But it was too little, too late. Loathing of the legislation had already reached a fever pitch and Ryan was powerless to steady the situation. The only thing he could have done to appease the far right—a full repeal of the Affordable Care Act—was not only legislatively impossible but would never pass the lower chamber of Congress. The vast majority of Republicans would have refused to eliminate Obamacare without knowing exactly what would replace it until months or years later.

In dissecting Ryan's lackluster marketing of the health care initiative, both his allies and adversaries in the Republican conference reached the same conclusion: He had taken support for granted. After all, this was essentially the same bill written by Price when he was in Congress; it became the de facto proposal of the House GOP in its “Better Way” agenda, which Ryan argued throughout 2016 was a governing document that his colleagues universally supported. "We all ran on this," Ryan said repeatedly over the past several weeks.

Except that many House Republicans never saw it that way. In fact, some conservatives spent the past year using "Better Way" as a punch line to tease the speaker for convening wonky groups to dream up big policy proposals—but never hold votes on any of them. If there had been committee hearings and floor votes, some conservatives argue, these differences would have surfaced much sooner. "We ran on these principles, but not on this bill," Meadows told me last week. (Meadows was, however, once a co-sponsor of Price’s bill in Congress.)

By Friday morning, there were questions about why Trump had kept a distance from the bill for such a lengthy period of time—and how different the whip count might look if he hadn’t.

As the reality of the bill’s likely defeat set in Thursday, and some members of Trump’s team began to assign blame to Ryan—most notably in a New York Times story—the speaker’s allies didn’t stand pat. They began subtly, first by calling Trump “the closer,” and then by emphasizing that the White House felt confident it would deliver the Freedom Caucus. By Friday morning, there were more overt questions about why Trump had kept a distance from the bill for such a lengthy period of time—and how different the whip count might look if he hadn’t.

Of course, leadership officials also were eager to blame the Freedom Caucus, claiming the group simply has no interest in voting yes. But the fact is, after Thursday night's impromptu conference meeting—in which Mulvaney delivered Trump's ultimatum that he would move on from health care after Friday's vote—the number of conservatives still opposed to the bill had dwindled significantly. There were 27 Freedom Caucus members voting no at the beginning of the week; by late Thursday, that number appeared to drop below 20. Jordan, worried that conservative opposition might be crumbling, spent Thursday night and Friday morning whipping his comrades to prevent further defections, members said.

Trump’s attempt to cajole the group into submission—tweeting Friday morning about the "irony" of its members opposing abortion but voting against a bill that removed Planned Parenthood funding—didn’t work, and probably backfired, just like his singling out of Meadows. I was told the members were slightly irritated but mostly laughed it off as "Trump being Trump," and expressed surprise that he hadn't tried to publicly pressure them ever sooner.

* * *

All this obscures an uncomfortable question for Republicans as they ponder how it is that they control both houses of Congress and the presidency, and yet were unable to get rid of a hated law they spent seven years attempting to destroy. Perhaps the problem isn’t who deserves the blame, so much as how to solve the puzzle that is the fractious GOP majority—the same impossible physics problem that bedeviled and ultimately doomed John Boehner.

After all, it wasn’t just conservatives who sank the AHCA. The Freedom Caucus remains a stubborn problem for GOP leadership, but blaming—or crediting—its members for Friday’s defeat ignores the fact that some two dozen moderate and centrist members were also opposed. "There's no natural constituency for this bill," Raul Labrador, a Freedom Caucus co-founder, said throughout the week. He was right. Members care about policy and process, and between the two, there was no clear upside for many of Ryan's members: It left too many people without coverage and failed to drive down premiums; it also was re-written hastily to accommodate changes and felt rushed for no good reason. Ultimately, every concession made to win conservatives, like the amendment that left regulating essential health benefits up to states, was destined to result in the loss of moderates.

Perhaps the problem isn’t who deserves the blame, so much as how to solve the puzzle that is the fractious GOP majority.

In the corridors surrounding the House chamber, the death knell was felt just before 11 a.m. That's when Rodney Frelinghuysen, chairman of the all-powerful Appropriations Committee, announced he wouldn't be supporting the bill. Republican lawmakers buzzed with disbelief as the news spread across the floor. Losing a committee chairman is never a good sign for leadership; the defection of the Appropriations chairman felt like a nail in the American Health Care Act's coffin.

An hour later, two sources—one in the House leadership, one in the Trump administration—confirmed that the whip count was moving in the wrong direction. One of them told me that Ryan was considering pulling the bill from the floor altogether, to prevent a lopsided defeat that would only serve to hand ammunition to Democrats running against Republicans who had been bold enough to vote for the bill anyway.

As I processed this, news broke that Ryan was headed the White House. He wanted to show Trump the numbers and consult him before yanking the bill from consideration. Soon enough the decision was made, and Ryan headed back to the Capitol, calling an all-conference meeting in the House basement.

Walking toward the tunnel that connects the House office buildings to the Capitol itself, I ran into Mark Walker, the chairman of the Republican Study Committee, a large caucus that was once home to the conservative movement in Congress before being eclipsed in recent years by the more ideologically pure Freedom Caucus. Walker had initially been against the bill, but came on board quickly after some changes, and in doing so validated the critiques of his group by those further to the right. A former minister, Walker is by nature relaxed and genteel, but his face was burning red and his voice trembled as we discussed the bill's defeat.

“I’m very bothered. I'm disappointed,” he said, measuring his words. “This was a chance to repeal all the Obamacare taxes. It was a chance to take off the burdensome mandate we've stuck on our employers and individuals who have begged for help. It [has] additional pro-life provisions. It destroys the chance to do the biggest Medicaid revision that we've had in what, 51, 52 years? Yeah, I'm bothered by it.”

On the opposite end of the spectrum were Meadows, Jordan, Labrador and Michigan Rep. Justin Amash, arguably the four core members of the Freedom Caucus. Moments before I talked to Walker, I had intercepted the four of them walking toward the meeting room. They hadn't heard the news; when I told them Ryan had pulled the bill, they exchanged glances and tried to suppress grins. Only Meadows looked upset; a southern gentleman and successful businessman, he wants to be liked by everyone, and the episode clearly took an emotional toll on him. He declined to provide a comment. So did Labrador and Amash. But Jordan, the godfather of the House conservatives—he arrived four years prior to the tea party wave of 2010—made clear that he wouldn't go along with Trump's decree that Republicans would abandon health care and move on to tax reform.

“We want to see Obamacare repealed,” Jordan told me. “That hasn’t changed.”

Ryan, for his part, told reporters in a somber press conference a short while later that he stood with Trump. Obamacare, that great white whale Republicans had long hunted—and hoped to harpoon on its seven-year anniversary Thursday—would remain “the law of the land” due to the GOP's inability to function as a “governing body,” the speaker of the House announced. They had failed at fixing the health-care system; next they would try to overhaul the tax code.

If you couldn’t get health care done, how can you get tax reform done?”

The improbability of this sequence was not lost on anyone. Earlier, as Ryan's motorcade was zipping toward the White House, I spoke with Kevin Brady, the Ways and Means chairman whose committee sits at the intersection of health care and taxes. I’ve known Brady, one of Congress’s truly decent people and a reliably cheerful spirit, for years; never had I seen him looking so despondent and defeated. Positing that health care was about to die, I asked Brady if re-writing the tax code would be any easier. “Tax reform is the hardest lift in a generation,” he told me, shaking his head. “So that would be a big challenge.”

“If you couldn’t get health care done,” I ask him, “how can you get tax reform done?”

Brady thought for a moment. “Every Republican is all-in on tax reform. We still have a lot of work. But it’s just a natural issue for us in a very positive way.”

But every Republican was all-in on repealing and replacing Obamacare, too, I told him. “Won't the devil be in the details?”

Brady stared back at me. “It always is,” he said. “It always is.”

Tim Alberta is national political reporter at Politico Magazine.