Here’s an after-action report, as Congress prepares to recess:

The signature Republican domestic-policy demand of the past seven years is dead again. Deader than ever. Brought down by Republicans themselves, in the face of nearly unanimously hostile public opinion.

Democratic constituencies have been mobilized to an intensity not seen since the worst days of the Iraq war. They have crowded town halls and barraged senators with phone calls and messages. The party’s serious internal differences—including over the future of health care—have been laid aside for the time.

Republican constituencies have been split and demoralized. Working- and middle-class Republicans have been put on notice: Their party wanted to cut their Medicaid and other health-care benefits. Why should they show up in November to vote for more of that?

Upmarket Republicans have been formally informed: Their party was duping them on Obamacare repeal, in all those years of yammering, it never developed anything like an alternative. The Obamacare taxes will remain in place, as will the law’s other costs and burdens. Why should they show up in November to vote for more of that?

The White House is melting down in recrimination, rage, and failure. While opponents condemn Trump as authoritarian and corrupt, supporters in Congress and media want to talk about almost anything else: Hillary Clinton’s presidential campaign, dirty rap lyrics—anything.

Donors are hearing that funds donated to the Republican National Committee and other party funds have been used to pay the personal legal bills of the supposedly super-rich Trump family—and that more such spending is probably on the way.

The special counsel’s investigation is triggering more and more erratic behavior from the president. Trump has repeatedly and publicly denounced his own attorney general—the one cabinet secretary executing a policy generally popular with the party’s conservative base, immigration enforcement. And this before the investigation has resulted in any legal consequences.

The president has achieved the lowest approval rating ever recorded for a chief executive at this point in his tenure, despite generally favorable economic news and the absence of any acute foreign-policy crisis.

The Democrats need take only 24 seats to flip the House.* There are 7 Republican incumbents on the ballot in California, where the president’s approval rating has tumbled to 25 percent, down five points since Inauguration Day. There are 5 more in New Jersey, where Governor Chris Christie’s approval rating has plunged to 15 percent.

The 2018 Senate map favors Republicans, but the president has gone out of his way to tie the single most imperiled Republican incumbent, Nevada’s Dean Heller, tightly to him and to the unpopular health-care bill. The president is waging open war against Arizona’s Jeff Flake—and his approval rating has sunk below 50 percent in states that might otherwise have been thought of as pickup opportunities, including Missouri and Michigan.

Republican talkers have been warning that the failure of repeal would doom the party’s chances in 2018. That’s not quite right: Repeal would have been so unpopular that its success would actually have been the worst GOP outcome. But what is right is that the internal party dysfunction—and White House chaos—that produced the repeal failure is also leading to electoral defeat. It may well produce an electoral defeat of the epic scale of 2006 and 2010 for the party of the most disliked and distrusted first-term president of modern times.

* This article originally stated that Democrats need to take 14 seats to flip the House. We regret the error.