It was only two months ago that Governor Sam Brownback was offering up the steep tax cuts he enacted in Kansas as a model for President Trump to follow. Yet by the time Republicans in Congress get around to tax reform, Brownback’s fiscal plan could be history—and it’ll be his own party that kills it.

The GOP-controlled legislature in Kansas nearly reversed the conservative governor’s tax cuts on Tuesday, as a coalition of Democrats and newly-elected centrist Republicans came within a few votes of overriding Brownback’s veto of legislation to raise income-tax rates and eliminate an exemption for small businesses that blew an enormous hole in the state’s budget. Brownback’s tax cuts survive for now, but lawmakers and political observers view the surprising votes in the state House and Senate as a strong sign that the five-year-old policy will be substantially erased in a final budget deal this spring. Kansas legislators must close a $346 million deficit by June, and years of borrowing and quick fixes have left them with few remaining options aside from tax hikes or deep spending cuts to education that could be challenged in court. The tax bill would have raised revenues by more than $1 billion over two years.

The Brownback blowback has been a long time coming. Though he won reelection in 2014, the governor has presided over one budget mess after another since then, and all but his staunchest conservative allies have blamed the crisis on reductions in personal tax rates and a provision that exempted 330,000 owners of small businesses from paying income taxes. Brownback has resisted efforts to undo the policies, preferring instead to raise taxes on tobacco, fuel, and other consumer goods. His relationship with Republicans in the legislature deteriorated, and in primary and general elections last year, a wave of Democrats and centrist Republicans defeated many of the conservatives who had stood by him.

The GOP may retain a majority in both chambers, but Brownback most definitely does not. “What we’re having is a standoff with the governor holding on to the old days where he had all these people elected,” said Senator Barbara Bollier, a moderate Republican who voters promoted from the state House last year. “They aren’t there anymore, and he can’t let go and follow the will of the people.”

As for Brownback’s legacy, Bollier said: “It’s going down in flames.”

The governor has fiercely defended the tax cuts, arguing that they stimulated job creation while it was the decline in oil and agriculture prices—the “rural recession,” as he calls it—that caused the budget shortfall. “They worked!” Brownback told my colleague Emma Green at the D.C. March for Life last month when she asked if he regretted signing the tax policies in 2011 and 2012. “The target of the tax cuts was job creation and new business formation. That was the target. And that it has done,” the governor said. “We’ve had record new business filings in Kansas and we hit record employment last year in spite of a commodity crisis.”

“The left media lies about the tax cuts all the time,” Brownback added. (His critics note that Kansas still lagged behind all but five other states in job growth last year.)

But it’s no longer merely journalists or even elected Democrats who criticize the governor in Kansas. Many Republicans have turned on him, too. When I spoke to Bollier and another GOP state lawmaker, Representative Stephanie Clayton, by phone on Thursday, both of them brought up the governor’s unpopularity without prompting. “The people can’t stand him here,” Clayton told me.

The backlash against Brownback is extending far beyond tax policy. The Kansas House this week passed bills to restore teacher tenure and expand Medicaid, and it blocked an amendment to deprive state funds to Planned Parenthood—a longtime target of the governor and other conservatives. The measures still face hurdles making it into law, but their approval by wide margins in a chamber controlled by Republicans illustrates just how much the political terrain has shifted away from the staunch conservatives who won decisive victories in 2010 and 2012. “All of those had been way off the agenda for the last four years,” said Burdett Loomis, a political scientist at the University of Kansas. “Basically the far right had controlled the legislature for the last four years, and now it’s back to a moderate Republican-Democratic coalition, which is the way it operated in the ’80s, the ’90s and into the 2000s.”

The stakes for Brownback’s fiscal policy were always high, because the governor himself had set them there. The original tax plan, he said, was a “real live experiment” in conservative fiscal policy—the kind small-government Republicans in Washington had dreamed about but had never fully implemented. The goal in Kansas was to phase out the income tax entirely over time in favor of levies on consumption. As revenues shrunk, so, too, would the size of government.

But the revenues dropped immediately, and dramatically—much faster than legislators could, or would want to, cut spending. The income tax had accounted for 50 percent of the state’s revenue, said Haley Pollock of the group Kansas Action for Children, which is part of a coalition pushing to reverse Brownback’s tax cuts. “When his tax plan went into effect, there was an immediate structural revenue imbalance,” she said. What followed were nine rounds of budget cuts over four years, three credit downgrades, missed state payments, and an ongoing atmosphere of fiscal crisis. “It’s really hard to argue that the income tax cuts weren't the source of our problems when most of our problems started at the same time that they took effect,” Pollock said.

Voters began to take notice, particularly when the budget ax fell on core state functions like education and the upkeep of roads and bridges. They reelected Brownback after a stiff challenge in 2014, but rank-and-file Republicans rebuked him by ousting his legislative allies two years later. “All of a sudden they realize, ‘Well you know what? We want government,’” Clayton told me. “People in Kansas tend to want the trains to run on time, proverbially. And they're not, because we cut too much.”

With encouragement from Trump, Republicans in Congress are drafting the most far-reaching tax reform in 30 years, built around cutting rates for individuals and businesses. Party leaders insist, as Brownback did, that the tax cuts will pay for themselves through larger economic growth. But Democrats and many economists say the plan would explode a deficit that’s already trending back up toward $1 trillion.

There’s a lesson in the Kansas experience, Clayton said, for Republicans in Washington, where the party has built a majority in the U.S. House that has, because of gerrymandering and poor Democratic turnout, seemed impenetrable. “The real example here is that the voters will get angry with you, and it doesn’t matter how solid-red your state is,” Clayton said. “If your voters get angry, then they will throw you out. And if you don’t run government functionally, they will go to the polls and get rid of you.”

Emma Green contributed reporting.