Updated on March 24 at 6:28 p.m. ET

To a man and woman, nearly every one of the 237 Republicans elected to the House last November made the same promise to voters: Give us control of Congress and the White House, and we will repeal and replace the Affordable Care Act.

On Friday, those lawmakers abandoned that effort, conceding that the Republican Party’s core campaign pledge of the last seven years will go unfulfilled. “I will not sugarcoat this: This is a disappointing day for us,” House Speaker Paul Ryan said at a press conference after he informed Republicans that he was ditching the American Health Care Act.

“We did not have quite the votes to replace this law,” Ryan said. “And, so yeah, we’re going to be living with Obamacare for the foreseeable future.”

Earlier in the afternoon, Ryan informed President Trump at the White House that the bill could not pass the House, as blocs of conservatives and moderates resisted a week of frenzied lobbying from the administration and were determined to vote no. The legislation had faced an avalanche of opposition from the outset. Democrats rejected any rollback of the Obama-era law, while conservative activists rebelled against a proposal that fell short of a full repeal. And as opposition mounted, Republicans representing swing districts and Democratic states began to pull their support, worried about cuts to Medicaid, a broader projected loss of insurance coverage, and a potential backlash from voters in the midterm elections next year. The nonpartisan Congressional Budget Office found that the proposal would increase the number of uninsured Americans by 24 million people over a decade, and a Quinnipiac University poll showed that just 17 percent of potential voters supported the plan, with 56 percent opposed.

Trump had initially insisted that Republicans hold a vote on the bill regardless of the outcome, wanting to see which members would defy him. He dispatched his top lieutenants to Capitol Hill on Thursday night to urge rank-and-file lawmakers to fall in line, ending negotiations with the party’s right and left flank on further changes to the bill. But few members were persuaded, and by Friday, party leaders in the House wanted to spare their members from having to cast a vote in favor of an unpopular bill that would not become law. At a hastily arranged meeting in the Capitol basement, Ryan told Republicans he had called off the vote and said Trump was on board with the decision. Minutes later, stone-faced lawmakers left the meeting and prepared to head back to their districts for the weekend. One Republican staffer was in tears as she exited the room.

While conservative members of the Freedom Caucus withheld their support despite winning a last-minute amendment to broaden the repeal, it was the defection of more moderate and electorally vulnerable members that sealed its fate. Republicans could afford to lose no more than 22 votes to achieve a majority, and in a statement at the White House Friday, Trump estimated that they were 10 to 15 votes short. In perhaps the most ominous sign for the GOP leadership, the chairman of the powerful Appropriations Committee, Representative Rodney Frelinghuysen of New Jersey, announced he would oppose the bill on Friday morning. In previous generations, it would be unheard of for a top committee chairman to oppose party leaders on such a major vote. Representatives Barbara Comstock of Virginia and David Joyce of Ohio followed suit about an hour later, sapping momentum from the effort less than a day after Trump delivered his ultimatum to Republicans to pass his bill or see Obamacare live on.

The White House and GOP leaders searched for votes wherever they could, but there were few lawmakers willing to suddenly support a bill they had already publicly denounced. Representative Walter Jones of North Carolina, a frequent dissenter in the party, said he waved off a last-minute call from the office of Representative Steve Scalise of Louisiana, the party whip. “I said, ‘Let me tell you: I don’t want to waste his time,’” Jones told reporters. “I don’t see anybody that was a no yesterday changing their vote.” He then ripped into the proposal and the leadership’s insistence that it pass. “This was absolutely a bad decision to move this type of bill this early,” Jones said.

Defeat on the floor dealt Trump a major blow early in his presidency, but its implications were far more serious for the Republican Party as a whole. Handed unified control of the federal government for only the third time since World War II, the modern GOP was unable to overcome its internecine fights to enact a key part of its policy agenda. The president now wants to move on to a comprehensive overhaul of the tax code, but insiders on Capitol Hill have long believed that project will be an even heavier lift than health care.

As the prospect of a loss became more real on Friday, the frustrations of GOP lawmakers loyal to the leadership began to boil over. “I’ve been in this job eight years, and I’m wracking my brain to think of one thing our party has done that’s been something positive, that’s been something other than stopping something else from happening,” Representative Tom Rooney of Florida said in an interview. “We need to start having victories as a party. And if we can’t, then it’s hard to justify why we should be back here.”

Nothing has exemplified the party’s governing challenge quite like health care. For years, Republican leaders resisted pressure from Democrats and rank-and-file lawmakers to coalesce around a detailed legislative alternative to Obamacare. That failure didn’t prevent them from attaining power, but it forced them to start nearly from scratch after Trump’s surprising victory in November. At Ryan’s urging, the party had compiled a plan as part of the speaker’s “A Better Way” campaign agenda. Translating that into legislation, however, proved a much stiffer challenge; committee leaders needed to navigate a razor’s edge to satisfy conservatives demanding a full repeal of Obamacare and satisfy moderates who preferred to keep in place its more popular consumer protections and Medicaid expansion. They were further limited by the procedural rules of the Senate, which circumscribed how far Republicans could go while still avoiding a Democratic filibuster.

The legislation Republicans came up with would have eliminated Obamacare’s insurance mandates and most of its tax increases, but it left in place many of the consumer protections that the public broadly supported. Conservatives were unhappy that the proposal did not immediately end the law’s Medicaid expansion or scrap all of its regulations, while moderates worried that the bill ultimately would leave too many of their constituents uninsured or facing higher costs than they do under the current system.

Both Trump and Ryan characterized Obamacare as a law in collapse, even as they acknowledged Republicans now were powerless to repeal it. But despite the challenges it still faces, Democrats rejoiced at an unexpected reprieve for an achievement that appeared to be doomed a few months ago. “Today is a great day for our country. It’s a victory,” declared Nancy Pelosi, the House minority leader who steered the Affordable Care Act to passage seven years ago this month. Hillary Clinton cheered the news on Twitter. “Today was a victory for the 24,000,000 people at risk of losing their health insurance, for seniors, for families battling the quiet epidemic of addiction, for new moms and women everywhere,” she said. “Most of all, it’s a victory for anyone who believes affordable health care is a human right.”

With the leadership’s plan dead, Republicans said they would try to move on to other issues. But the party’s failure on health care will sting, and it will linger. On Friday, Ryan was asked what GOP lawmakers should say to their constituents after promising them for so long they would repeal and replace Obamacare. The speaker was stumped. “That’s a good question,” he replied. “I wish I had a better answer for you.”