At a rally in October, just before the election, Donald Trump made a promise. He would make it his priority to repeal Obamacare. “My first day in office, I am going to ask Congress to put a bill on my desk getting rid of this disastrous law and replacing it with reforms that expand choice, freedom, affordability.”

For the past month, Trump has worked with Speaker of the House Paul Ryan to deliver that bill. Of course, what they crafted wasn’t what he promised to the American public. Far from enhancing coverage or making it more affordable, the American Health Care Act would have ended insurance for 24 million people, raised costs for millions more, and used the savings to cut taxes for the wealthiest Americans. But Trump both endorsed it and made it a priority. And for Ryan, it was the key part of a larger agenda: the beginning of the end of Medicaid and the first stage in passing a set of massive, permanent tax cuts.

Together, Trump, Ryan, and their allies have spent the past two weeks trying to pass this bill, despite vocal condemnation from Democratic voters and firm opposition from much of the medical industry and other key interest groups. But their biggest obstacle wasn’t from the left or the center, but from the right. For the most conservative members of the House, the only option was full repeal, and the American Health Care Act preserved the structure of Obamacare. Absent major changes, they wouldn’t back the bill.

With a vote scheduled for this week, Trump and Ryan had to find a solution. And so they capitulated. They gave these members, the House Freedom Caucus, what they wanted—an end to the Affordable Care Act’s essential health requirements. Still, for some members, it wasn’t enough. Worse, these changes—which would destroy the individual health insurance market as it existed—drove less doctrinaire Republicans out of the tent.

Unable to balance the two sides, and facing a public that hated the bill, Trump and Ryan gave up. There would be no vote, and there would be no repeal. Obamacare would live. Trump, naturally, blamed the Democrats for this defeat. “Look, we got no Democratic votes. We got none, zero,” said Trump in a telephone interview with the New York Times. “So when you get zero from the other side—they let us down because they’re hurting the people. The good news is they now own health care, they now own Obamacare.” Speaking to the Washington Post, Trump deflected all responsibility for the fiasco. “I never said I was going to repeal and replace in the first 61 days,” he said.

Except, he did. This is a failure of his making. He joined Ryan in making this the party’s first priority. He agreed to a shoddily crafted bill that reneged on all of his promises and angered nearly every relevant stakeholder. He invested time and energy in passing that bill, and he has helped give the Republican Party the worst of all worlds: a legislative failure that exacerbates existing splits, sows further division, and gives the opposition a template for the midterms.

Indeed, it’s hard to overstate the scope of this disaster. Social policy of this scale is a massive undertaking. It requires broad consensus, policy expertise, clear White House direction, and strong congressional leadership. And even then, failure is always on the horizon. It took Democrats more than a year—and countless crises and complications—to craft and pass the ACA. What we’ve seen, over the past month, is that none of these ingredients exist among the present batch of Republican leaders in Washington. The Republican Party has no vision for health policy reform, no mutually agreed set of goals or principles. Instead, it has seven years of anti-Obamacare demagoguery. At the same time, President Trump’s ignorance—and overall disinterest in the business of policy—means his White House has little to negotiate or bring to the table. Paul Ryan’s inexperience as a congressional leader means he can’t corral members for difficult votes. And beyond problems of leadership, the fact that Trump and Ryan would essentially play games with 18 percent of the economy makes it clear that the Republican Party is unprepared for the responsibility of governance. That they now plan to tackle tax reform, an even heavier lift than health care, shows either arrogance, ignorance, or both. Trump, at least, should know that losing often begets losing and that a loss of this magnitude may have heavy consequences for the future of his agenda.

It almost goes without saying that Democrats have an unprecedented gift. By simply describing the AHCA and the GOP effort to pass it, they can tie their opponents to dysfunction and cruelty. They can show, in vivid terms, what the Republican Party would do to the public if it had the chance—if it could get itself together. Democrats have no excuse; they should blast the Republican Party with its failure and use the opportunity to tout a comprehensive plan for improving the Affordable Care Act. This could take several forms. They could embrace Sen. Bernie Sanders’ call for universal Medicare; they could introduce a public option to the exchanges, coupled with more generous subsidies; they could announce a plan to federalize and expand Medicaid even further; or they could do a little of each, writing a simple proposal that opens Medicare up to older Americans not yet on there, provides greater subsidies in the health care exchanges, and closes any coverage gaps with Medicaid. And in the short term, they can pressure individual states to adopt the Medicaid expansion as it exists. Whatever the path they choose, Trump’s health care quagmire gives Democrats a chance to move the ball forward and show Americans a real path toward affordable insurance and universal coverage.

Beyond the politics of this debacle, it’s worth saying that Trump’s failure is a boon for the millions of Americans who rely on Obamacare—either through subsidies or Medicaid—for access to the health care system. In beating back the Republican effort, defenders of the Affordable Care Act saved lives and kept countless people from financial ruin.

There’s a lesson here. Organizing works. Calling your lawmaker works. Showing up to make your voice heard works. Yes, the collapse of Trumpcare wouldn’t have happened without a perfect storm of hubris and incompetence at the top, but on the ground activism made those winds more potent by weakening the resolve of rank-and-file lawmakers and stiffening the spines of Democratic politicians.

Liberals and the left won’t always succeed—that’s what it means to be in the minority—but they have a path forward. They have a way to win.