(Amber Ferguson/The Washington Post)

The Republican Party’s seven-year quest to undo the Affordable Care Act culminated Friday in a humiliating failure to pass an unpopular bill, sparking questions about how steep the costs will be for its congressional majorities.

While lawmakers have not completely abandoned the effort, they are now confronting the consequences of their flop. Not only has it left the GOP in a precarious position heading into next year’s midterm elections, but it also has placed enormous pressure on the party to pass an ambitious and complex overhaul of federal taxes.

Strategists argued for months that Republicans risked more by not acting and alienating their conservative base than by passing an unpopular repeal bill that could turn off swing voters. They now live in the worst of both worlds — with nothing to show for seven years of campaign promises, even though dozens of vulnerable lawmakers cast votes that could leave them exposed to attacks from Democrats.

“This is an epic failure by congressional Republicans,” said Tim Phillips, president of the conservative Koch network group Americans for Prosperity. “But it’s time to pivot to tax reform. There’s no time to pout.”

In the moments after the bare-bones repeal bill failed early Friday morning, Senate Majority Leader Mitch McConnell (R-Ky.) said it was “time to move on.” But there seemed to be little stomach afterward among Republicans on Capitol Hill for acknowledging outright failure on their top campaign promise.

Senate Majority Leader Mitch McConnell during an all-night session to consider the Republican health-care bill on Thursday July 27, 2017. (Melina Mara/The Washington Post)

Lawmakers did agree, however, that when they return to Washington after Labor Day, they must succeed in their rewrite of the tax code after seven months that have seen too many of their top agenda items untouched.

“We’ve asked the voters for a lot,” said Rep. James B. Renacci (R-Ohio), who is leaving Congress after his current term to run for governor. “They’ve given us the House. They’ve given us the Senate. They’ve given us the presidency. It’s time to give them something back and get something done.”

Off the Hill, the collapse of the repeal effort has left conservative activists fuming about how the GOP could have flinched and pondering payback for the party establishment — particularly several moderate senators who voted for ACA repeal legislation when it had no chance of becoming law only to balk when it did.

In campaign after campaign since the ACA was enacted in 2010, GOP candidates used pledges to “repeal and replace Obamacare” to gain majorities in the House and Senate, and President Trump promised to unravel the law as one of his first acts in office.

Instead, Republicans have continually failed to coalesce around an alternative — vividly demonstrated by the dramatic failure of the “skinny repeal” on the Senate floor early Friday morning. They appear trapped in the fallacy of sunk costs: Having invested so much political capital in the ACA’s repeal, they cannot possibly abandon it.

Numerous House lawmakers leaving a closed-door Republican conference meeting hours after the Senate bill collapsed said that efforts to undo the increasingly popular health law would have to continue.

“I am disappointed and frustrated, but we should not give up,” House Speaker Paul D. Ryan (R-Wis.) declared.

Rep. Mark Meadows (R-N.C.), the leader of an influential bloc of House conservatives, insisted a deal was still within reach and said he’d approached key senators. And while Trump said he would “let Obamacare implode,” he also urged senators on Twitter to jettison their filibuster rules to pass “really good things.”

But key figures warned Republicans to move on before the health morass sinks the rest of the party’s agenda — most importantly, the tax overhaul.

“Quarantine it,” said Josh Holmes, a GOP strategist and former chief of staff to McConnell who coined the “repeal and replace” mantra in 2010. “You can let it destroy your entire agenda and your entire party as a result of inaction by continuing to dwell on something that, frankly, they’ve proven unable to do.”

But conservative activists have been furious in the aftermath of the repeal vote and have cast about for ways to punish those they consider responsible.

The three Republican senators who cast the decisive votes on Friday — Susan Collins of Maine, John McCain of Arizona and Lisa Murkowski of Alaska — are largely immune to immediate electoral consequences. Murkowski, who withstood public pressure from Trump, is less than a year into a six-year term; McCain, also reelected last year, is battling an aggressive form of brain cancer; and Collins, who has not faced a serious primary threat since 1996, next stands for reelection in 2020 and is considering a run for governor next year.

But activists are still angry that several other Republican senators — Dean Heller (Nev.), Lamar Alexander (Tenn.), Shelley Moore Capito (W.Va.) and Rob Portman (Ohio), as well as McCain and Murkowski — voted for an ACA repeal measure in 2015, when President Obama was certain to veto it, but opposed an almost identical measure this week knowing Trump could sign it into law.

“That level of cynicism is breathtaking, even in the political world,” said Phillips of Americans for Prosperity, which helped drive the public backlash to the ACA ahead of the 2010 Republican congressional wave.

Only Heller faces reelection next year, however, and he has yet to attract a conservative primary challenger despite emerging as a key swing vote who pushed to reduce the scope of the Senate’s efforts.

Adam Brandon, president of the conservative activist group FreedomWorks, said Heller “opened himself wide open” to a primary challenge: “By bending over backwards to save Medicaid expansion, to preserve the fastest-growing entitlement program in the United States, what conservative, Republican, libertarian constituency were you serving?”

Brandon, whose group deemed the turncoats “Freedom Frauds,” said the events of the past months have revealed a party with a double standard in handling its right flank versus its more moderate faction.

Had the Senate’s leading conservatives tanked the health bill, he said, “they would be recruiting someone to primary Mike Lee and Rand Paul and Ted Cruz, but that’s not happening” with Collins, McCain and Murkowski. He also suggested that the committee chairmanships held by the trio ought to be at risk.

In the House, the political challenge posed to Republicans is the opposite: Dozens of members targeted for defeat by national Democrats voted for the American Health Care Act, the GOP bill judged by the Congressional Budget Office to result in higher premiums for older and sick Americans.

Democrats made clear they intend to use that vote in their 2018 campaigns, even if the bill was never ultimately made law.

“House Republicans can’t turn back time and undo the morally bankrupt vote they took to kick 23 million Americans off their health insurance, impose an unfair age tax and cause skyrocketing premiums,” said Tyler Law, a spokesman for the Democratic Congressional Campaign Committee. “Speaker Ryan and all House Republicans own their disastrous bill, and it will certainly haunt their imperiled Republican majority in 2018.”

On the flip side, House Republicans who cast votes for the bill cannot point to any finished product that might motivate more conservative voters. Rep. Steve Stivers (R-Ohio), the chairman of the National Republican Congressional Committee, insisted that the circumstances surrounding the health bill would actually work to the GOP’s benefit.

“Our base knows what we did,” Stivers said. “But it also isn’t going to become law, so . . . I think they have a hard time really punishing our members for some theoretical details.”

A handful of moderate Republican lawmakers said Friday they would be open to pursuing a bipartisan fix to the ACA. But for most rank-and-file Republicans, the approach is simple: Never say die.

“It’s only a defeat if we surrender,” said Rep. Barry Loudermilk (R-Ga.). “Look, the U.S. Navy was devastated at Pearl Harbor, but three years later the Japanese surrendered to us. . . . The history books of America are marked by us rebounding from defeat and turning it into victory. We’re going to keep pushing.”

Inside the closed-door conference meeting Friday, Rep. Bruce Poliquin (R-Maine) showed his colleagues clips of early Atlanta Falcons touchdowns in this year’s Super Bowl — a game won by the New England Patriots after a furious 25-point comeback.

Plenty of House members showed a willingness to hang the health bill’s failure on the Senate, which due to its filibuster rules has yet to take up or pass dozens of significant House bills. In a final meeting before a five-week summer recess, Ryan told his colleagues that they represented the most functional branch of government.

But several House members said they were skeptical House Republicans would be able to separate themselves from the other chambers’s failure and feared that they, too, would suffer from a dejected GOP base.

Rep. Mike Bost (R-Ill.), who represents a blue-collar downstate district Democrats are heavily targeting in 2018, said he rarely encounters a constituent who airs frustrations with a particular chamber.

“They never say, ‘Well, it’s the Senate or the House.’ What they say it is, ‘It’s Congress,’” he said. “I can’t change who the Senate is, okay? But I can keep doing my job, and that’s what I intend to talk about.”