In a divided legislature, Virginia Gov. Terry McAuliffe (D), center, has come up short for the third year in a row on extending Medicaid health insurance coverage. (Bob Brown/AP)

In Illinois, a prolonged political stalemate over the state budget has shut homeless shelters, drug treatment centers and mental health clinics that serve the poor.

A similar impasse in Pennsylvania has forced school districts to slash budgets by cutting back on textbook purchases, test preparation and building repairs.

The partisan standoffs that regularly paralyze federal Washington are also hobbling a growing number of state capitals. They have frustrated governors and legislators alike, and aggravated the public’s ire over ineffective government.

The tally of states with divided government — where governors face at least one legislative chamber controlled by the other party — has nearly doubled in the past two years.

Moreover, like their national counterparts, Republicans and Democrats in state offices have moved further apart in their thinking, analysts say. That makes it harder to reach compromises on key topics including taxes, unions, health care and abortion.

“It has gotten more polarized,” William T. Pound, executive director of the National Conference of State Legislatures, said. “In most places, it is not as bad as at the national level, but it reflects the country.”

As a GOP presidential candidate runs a populist campaign for president, tapping into the anger over the impasse in Washington, state governments are having the same trouble getting things done.

The impact has been most severe this year in Illinois and Pennsylvania. Political deadlocks have prevented both states from approving budgets eight months into the fiscal year.

The burden has fallen primarily on low-income communities and education. In Illinois, the loss of state grants has forced social service providers across the state to lay off workers and close facilities. A state college has warned it may have to suspend classes in the spring.

“The big picture unfortunately is more people ending up in hospitals, emergency rooms and jails,” Marvin Lindsey, chief executive of the state’s Community Behavioral Healthcare Association, said. “More families will be disrupted, more kids severely traumatized.”

The Pennsylvania impasse has plunged local school districts into chaos. Their state association has sued the governor and legislature seeking full funding for the current school year.

Closer to Washington, Virginia Gov. Terry McAuliffe (D) and Maryland Gov. Larry Hogan (R) have both seen top goals blocked by legislatures dominated by the opposing party.

But while McAuliffe and the GOP have managed to cooperate on some issues, the discord in Annapolis has worsened.

In the Richmond session that ended Friday, McAuliffe came up short for the third year in a row on his principal legislative priority, extending Medicaid health insurance coverage to about 400,000 low-income Virginians under Obamacare.

The Republicans, who control both chambers of the General Assembly, said expansion would cost the state too much money in the long run, even after McAuliffe sweetened his offer from a year ago.

McAuliffe effectively conceded defeat early. He made little effort during the session to press the issue, and didn’t repeat his failed effort of two years ago to block the budget altogether unless it expanded Medicaid.

Instead, McAuliffe tried to build a legacy by focusing on bipartisan goals such as luring investors to the state to create jobs. He also struck limited deals with the GOP on some issues, notably gun policy. That alienated some of his most reliable liberal supporters, but it gives him something to crow about.

“In general, divided government forces down the scope of things that get done,” said Alan Ehrenhalt, senior editor of Governing magazine. “It tends to take big issues off the table and shift to battles over smaller topics where they can sometimes reach agreement.”

Across the Potomac, Hogan has also had to scale back his ambitions in the face of sizable Democratic majorities in both chambers of the General Assembly.

One of his signature goals is cutting taxes and fees. But this year, he proposed only modest reductions of $37 million, or one-fifth of 1 percent of the operating budget of $17 billion.

Democrats showed their muscle at the start of the session by overturning all six of Hogan’s vetoes from the previous year.

The partisan struggle in Annapolis has also yielded some harshly worded exchanges.

In a recent low point, Hogan accused legislators of behaving like destructive teenagers on spring break. On the same day, African American legislators accused him of making racially motivated spending decisions that hurt black communities.

Todd Eberly, a political scientist at St. Mary’s College, said both sides were at fault. Hogan’s comments were “insulting and unjustifiable,” Eberly said. But, he added, “for members of the Black Caucus to essentially call him a racist was just shocking and disappointing.”

Widening division

The extent of divided government in state capitals ebbs and flows with political tides, and recently the tide has been rising.

The number of state capitals with divided government has jumped from 11 to 20 since the middle of 2014, according to the National Conference of State Legislatures.

Analysts attribute the increase to a mix of causes, including a general widening of the partisan divide, turnout trends in off-year elections and gerrymandering of legislative districts.

The confrontations are sharpest in states with governors confronting legislatures where both chambers are controlled by the opposition. That’s the case in Illinois, Pennsylvania, Maryland and Virginia, as well as Alaska, Louisiana, Massachusetts, Missouri, Montana, New Hampshire, New Jersey and West Virginia.

The states where the legislatures are divided are Colorado, Iowa, Kentucky, Maine, Minnesota, New Mexico, New York and Washington.

Some states have divided government partly because governors and legislatures are elected in different years. That can be a factor because Democrats tend to do better in presidential election years, when turnout is higher.

Gerrymandering — which is the drawing of electoral districts to favor one side or the other — tends to encourage polarization by creating more “safe” districts for incumbents. They rarely face a serious challenge from the opposing party and thus cater to their activist bases.

The result is fewer moderates in each party, and thus fewer opportunities to bridge the partisan divide.

“The middle tends to govern in legislatures, and I think the middle has gotten smaller,” Pound said.

Fundamental issues

The challenges of divided government are most serious when fundamental principles are at stake. That’s the case in Illinois, where a key issue is labor unions’ power, and in Pennsylvania, where the main dispute is over raising taxes to fund education.

By contrast, state governments are able to move ahead on less-controversial issues, such as combating opioid addiction.

The Illinois deadlock arose after Republican businessman Bruce Rauner was elected governor in 2014 and confronted an entrenched Democratic legislature.

As a condition for signing a budget with increased revenue, Rauner is insisting on pro-business measures that he says are needed to help the state’s economy. They include changes in collective-bargaining rights and workers’ compensation.

The Democrats, led by longtime Illinois House Speaker Michael J. Madigan, say the plan would reduce the standard of living for the state’s workers. It also would undermine labor unions, the bedrock of Democrats’ power there.

“Both sides consider it to be a titanic political struggle for the future of Illinois,” said David Ormsby, editor of the Illinois Observer, an online publication.

The impact on charitable groups that receive state grants has become severe as the gridlock has dragged on. For example, Lutheran Social Services recently announced the elimination of 750 positions, or 43 percent of its workforce. It said about 4,700 people will no longer receive its services, particularly seniors who receive home care.

“It has been an agonizing process,” said Mark A. Stutrud, president of the group. “Many of our employees are direct-care personnel who have built relationships and strong trust with the people they serve.”

For such groups caught in the middle, it’s long past time to cut a deal.

“There’s enough blame to go around for everybody right now,” said Lindsey of the behavioral- health association. “Each branch has to take responsibility for how these people are being treated.”

The political roles are reversed in Pennsylvania. There, Democratic Gov. Tom Wolf is wrestling with a Republican-controlled legislature.

Wolf was elected after a campaign in which he advocated raising taxes to restore education funds cut under his predecessor, Tom Corbett (R), whom he defeated.

But the legislature rejected Wolf’s effort to deliver on that promise, so he took a seemingly contradictory step: He used his veto power to block spending about half the state school budget in an effort to pressure the legislature to increase funds for K-12 education.

The impact has been severe. School districts have had to borrow millions of dollars to keep classes open, while sharply reducing spending. Three in 10 school districts said they were skipping payments to charter schools, and nearly 1 in 5 were missing pension contributions.

“Some are putting tutoring and remediation programs for students on hold,” said Steven Robinson, spokesman for the Pennsylvania School Boards Association. “Test scores are going to be impacted by that.”