CHICAGO — Illinois residents aren’t the only ones throwing up their hands at the gridlock and increasingly polarized politics that have defined state government in recent years. More and more, fed-up and frustrated Illinois legislators are heading for the exits.

More than two-dozen legislators — about 15 percent of the General Assembly — have either resigned months into the current session or said they won’t seek re-election. They are Democrats and Republicans, rank-and-file moderates and those in leadership posts, including House Majority Leader Barbara Flynn Currie, who said last week that she’s ending her nearly 40-year legislative career when her term expires.

It’s an exodus that longtime Statehouse observers say is unusual not just for the high number of lawmakers leaving, but for the reasons many legislators are giving: frustration with not being able to reach compromises, the stress of the two-year budget impasse that only recently ended, year-round campaigning and a public that’s grown more hostile and vocal.

“There is a toxic environment. People seem to not be able to get along, even outside of the Capitol,” said retiring Republican state Rep. Steve Andersson. “That’s not a good environment, and that’s not an environment I want to be a part of.”

Andersson received hate mail and even a death threat after he and about a dozen other Republicans broke with GOP Gov. Bruce Rauner to support a deal to end the budget stalemate that included an income tax increase. He also lost his position as the GOP’s House floor leader. A short time later, he announced he isn’t running again.

Turnover in government isn’t new. Nor are politics that many may find distasteful — particularly in Illinois. Several governors have gone to prison, and multiple public-opinion polls have found Illinois residents are especially distrustful of their government.

But what’s happened in recent years has been different, as a standoff dragged on between Rauner — a multimillionaire former businessman — and longtime Democratic legislative leaders, namely House Speaker Michael Madigan.

With the two sides unable to agree on a budget, social service agencies and universities suffered, while the state racked up billions in unpaid bills. The 2016 legislative elections featured several bruising contests, including primary challenges bankrolled largely by Rauner and his wealthy friends, and labor unions determined to stop his anti-union agenda.

As the fights stretched into 2017, more and more lawmakers started issuing resignation letters.

Some are running for other offices — from water reclamation district commissioner to governor — though many say the job isn’t fun anymore, said Mike Lawrence, who has worked in and around state government for 50 years.

“My sense is we’ve never seen anything quite like this,” Lawrence said. “I worry it’s becoming a trend.”

Many of those calling it quits are Republicans like Andersson who helped Democrats override Rauner’s veto of the budget deal. They have either grown weary or see a primary challenge coming from those angered by the tax hike.

In his resignation letter, GOP state Rep. Chad Hays said “dislike and distrust” between Rauner and Madigan “has paralyzed government in Illinois.”

“Ego, money and power eclipse the desire of well-meaning and honest public servants,” Hays wrote. “Blame, press conferences and talking points have replaced governing. Voices of moderation and reason are increasingly being elbowed out by well financed fringe elements.”

Democrats, too, say they’ve been worn down. State Rep. Elaine Nekritz, who is voluntarily ending her 14-year legislative career, said she cried multiple times while talking to constituents hurt by the budget crisis.

State Rep. Carol Sente said solving problems became tougher to do as the dynamics of the General Assembly changed, with more legislators from the far right or left. Many lawmakers blame this on gerrymandering, in which political districts are drawn up to be safely Democratic or Republican.

Sente also tired of the constant campaigning.

“For those of us in competitive districts with races every two years, to spend five solid months every other year campaigning, working your butt off and eating drive-through meals, once you win that battle, you want to make a difference, to legislate, compromise and fix problems,” Sente said.

“The impasse and the partisanship are cumulative and it adds up. So over time, I think there is a threshold for everyone when they say, ‘I need a break or I’m done.'”