As President Trump and Congressional Republicans regroup following the collapse of their efforts to repeal and replace the Affordable Care Act they should look not only at what went wrong with their legislation but also past efforts to reform American health care.

While many things went wrong, the biggest stumbling block to the GOP efforts this year was the attempt to dramatically change the Medicaid program, which serves some 70 million Americans. Both the House-passed and pending Senate bills would have replaced the 52-year-old entitlement program with capped federal spending and a state-run block grant. The federal government would continue to share in the program’s costs but annual growth would be tightly limited, leaving states with the job of balancing the health needs of their citizens with the new fiscal realities. While only tangentially related to the ACA, the Medicaid caps and block grants were too much to swallow for many moderate Republicans.

For most of its history, Medicaid took a back seat to Medicare, the health benefits program for seniors and others. But now, due to its growth in size and cost Medicaid has gained so much clout that it should be considered the new “third rail” of American politics. To be sure, some politicians have long seen Medicaid as target ripe for cutting federal spending. But many more are leery of touching the program and facing the wrath of the people who elected them.

The difficulties encountered by the President, House Speaker Paul Ryan of Wisconsin, and Senate Majority Leader Mitch McConnell of Kentucky are eerily similar to those faced by the nation’s 40th President, Ronald Reagan. Instead of providing a roadmap to victory, the story of Reagan’s efforts is a cautionary tale.

Past Is Prologue

In 1981, perhaps Reagan’s most successful year of domestic policy legislative victories, a centerpiece of his budget was a plan to repeal the Medicaid entitlement and replace it with a state-run block grant. Federal spending for Medicaid would be sharply reduced and states would be required to make up the difference by cutting millions from the program. Sound familiar?

Reagan included his Medicaid block grant proposal in his sweeping plan to cut government spending while reducing taxes across the board. With a new GOP majority in the Senate and a near-majority in the House, Reagan won a string of significant victories that reshaped U.S. domestic policy in ways that moved the nation dramatically to the right and set the tone for the next 20 years of Congressional debates about deficit spending and tax relief. Reagan asked Congress, for the first time, to use a new budget “reconciliation” process to consider his spending and tax policies.

The Senate, behind the leadership of Finance Committee Chairman Bob Dole of Kansas, approved the Medicaid block grant as part of its budget reconciliation bill. In the House, however, Reagan’s plan ran into a solid brick wall thanks to the wily leadership of a young Henry Waxman. The California Democrat had only recently taken the helm of the House Health Subcommittee and was determined to preserve the Medicaid entitlement even as he gave way on a number of Reagan’s other health care priorities.

Following a heated debate that June, the House approved Reagan’s blueprint for spending cuts with one glaring exception. The Medicaid block grant proposal was pulled from the larger bill and House members were asked to vote on it in isolation. Waxman and his allies worked hard to garner support from governors of both parties, as well as organizations representing doctors, hospitals, drug companies, and others to defeat Reagan’s plan. At the same time, House Republican leaders tried to win the day by tweaking the Medicaid block grant proposal. In the end, the Republicans withdrew the Medicaid reform bill without a vote.

Knowing he couldn’t protect Medicaid from any pain, Waxman offered an alternative plan that made significant cuts in federal payments to states for the next three years. So, Reagan got the savings he wanted but not the structural change to the program the GOP desired.

Where Do We Go From Here?

Watching this year’s debate over Trumpcare certainly provides a dose of déjà vu. While their number is dramatically smaller than in 1981, moderate Congressional Republicans are among the key holdouts that are making passage of repeal and replace so difficult. Such Republican governors as John Kasich of Ohio and Brian Sandoval of Nevada led the opposition from the states. Like their predecessors, these state leaders recognized that cuts the size of those proposed this year would force them to eliminate eligibility for millions of their residents.

Trump, Ryan, and McConnell are certain to try to reform Medicaid again. In fact, in their fiscal year 2018 budget blueprint House Republicans have assumed more than $1 trillion in Medicaid savings over the next decade. If they want to avoid the shocking results of touching the third rail, the GOP leaders might want to look to another example from the Reagan era. After killing the Medicaid block grant in 1981, Waxman and Dole worked together to enact a series of important changes to Medicaid that expanded coverage for key populations—pregnant women and young children—and introduced new innovations—including home and community-based care waivers—that improved care and reduced spending growth. Similar bipartisan efforts are the best way to move forward and avoid that perilous rail.