Officials in both parties attribute the Democrats’ run in part to the party’s motivation to fight back in the Trump era, scandals that have forced Republican legislators to resign, and the low-turnout quirkiness of special elections. But the overriding factor is likely a budget crisis that has starved funding for Oklahoma’s schools, resulting in a teacher shortage and prompting more than one-quarter of the state’s districts to hold classes only four days a week.

“The people are just not happy,” former Oklahoma Governor Frank Keating, a Republican, told me in a phone interview. “Government appears dysfunctional, and government officials appear unwilling to solve the problems of the state and the nation. And there will be hell to pay.”

The political backlash in Oklahoma has parallels to the recent reckoning in Kansas, its neighbor to the north and another Republican-led state where deep tax cuts led to significant, ongoing budget shortfalls. Both states are heavily reliant on the oil-and-gas industries, and the drop in prices in recent years hit their economies hard and contributed to a falloff in state revenues. In Kansas, voters rebelled by ousting conservatives in favor of moderate Republicans and some Democrats in 2016. Earlier this year, the reconfigured legislature voted to roll back the signature tax cuts of conservative Governor Sam Brownback.

Lawmakers in Oklahoma City are now debating similar measures, and the Democrats’ special-election victories could help tip the balance in a state where a third-quarter super-majority is needed to raise taxes. “It really feels like the dam has broken, and the conversation has shifted in Oklahoma,” said David Blatt, executive director of the Oklahoma Policy Institute, a left-leaning advocacy group and think tank.

The budget crisis in Oklahoma has been longer in the making than the one that erupted in Kansas soon after Brownback signed his tax cuts in 2011 and 2012, Blatt said. And it implicates both parties, since it was a Democratic governor, Brad Henry, who first agreed to cut the state’s income tax in exchange for future increases in teacher pay and spending.

Those policies accelerated after Mary Fallin’s election as governor in 2010 gave Republicans full control of the government in Oklahoma, which Democrats had dominated at the state level for nearly the entire century after it joined the Union in 1907. A state that was once near the national average in the percentage of income taxes it collected from residents fell to 48th in the nation by 2014. In addition to about $1 billion in annual income tax cuts, Oklahoma have legislators voted to give between $300 million and $500 million in yearly tax breaks to the oil-and-gas industry, according to Blatt. “It’s been a serious erosion of our tax base,” he said.

In Kansas, Brownback resisted any reversal in his tax cuts on income, forcing Republican majorities to override his veto earlier in the year. But Fallin has taken the opposite approach, demanding that conservatives in the state legislature pass a budget that has substantial and recurring new revenues. A 1992 state law requiring super-majority support for tax increases has made that a challenge, however. Fallin earlier this month vetoed parts of a “cuts-and-cash” bill that closed the budget gap with a combination of one-time money transfers and spending reductions, which will likely force the legislature into a second special session to consider tax increases.