The tribulations of Donald Trump have opened opportunities for the Democrats to regain lost ground in several of the nation’s Republican-dominated statehouses.

“There’s a danger the dike could break for Republicans,” says Tim Storey, who analyzes politics for the National Conference of State Legislatures. He found that there has been a sea change in expectations on both sides since Oct. 7 when The Washington Post reported on the existence of the “Access Hollywood” recording in which Trump crudely described making unwanted advances on women. Republicans have become increasingly concerned that they could lose statehouse majorities in as many as 10 states, Storey said.

Recent polls also show Democrats doing well in governors’ races, with a solid chance to replace Republicans in Indiana and North Carolina. These surveys also show Democrats likely to fend off GOP challenges in governors’ races in Missouri, Montana and New Hampshire.

An assessment of U.S. Senate races by Jennifer Duffy of the Cook Political Report mirrors Storey’s perception of a Democratic surge in statehouses. “Since the release of the ‘Access Hollywood’ tape,” Duffy wrote, “Senate Republicans have seen their fortunes dip, particularly in states like Florida, North Carolina, New Hampshire, Nevada and Pennsylvania where [Hillary] Clinton has established a lead. … In the Senate seats in the toss-up column, Trump only leads in Indiana and Missouri where both Republicans are running a few points behind him.”

Even before the Trump implosion, 2016 loomed as an opportunity year for Democrats, in part because Republicans may have gone a bridge too far in the 2014 midterm elections when they won several marginal districts to boost their numbers to the highest level since the 1920s.

If history is a guide, Democratic legislative candidates stand to gain from a Clinton victory. In the half-century since the Supreme Court mandated legislative redistricting on the basis of one-person, one-vote, the party winning the White House has gained an average of 129 state legislative seats.

Democrats need a strong showing in state races to offset heavy losses during President Obama’s tenure, when Republican legislative candidates won a net of 816 seats. The GOP now controls 67 of 98 partisan legislative chambers. Republicans have a majority in both chambers in 30 states; Democrats control both in only 12, with control split in seven states. (Nebraska has a unicameral, non-partisan chamber.) Republicans have 31 governors, the Democrats 18. Alaska’s governor is an independent.

Three state senates in which Republicans hold a one-seat margin--Colorado, Nevada, and Washington--could swing to the Democrats in next month’s election. Democrats are also targeting the Senate in West Virginia, even though it is an almost certain Trump state, which the GOP controls by two seats. Additionally, Democrats appear poised for gains in Wisconsin, where Republicans hold a five-seat margin in the Senate, and in Arizona, where the Republican Senate margin is six seats.

The New York Senate, which has bounced back and forth for several years, is a target for both parties. Democrats hold a 32-31 majority but the chamber is run by a coalition of maverick Democrats aligned with the Republicans.

In the houses and assemblies, Democrats hope to win Minnesota, Nevada, New Hampshire, and New Mexico.

But Trump has pockets of strength, observes Storey, and Republicans have targets within them. Perhaps most promising is the Iowa Senate, which Democrats control by a single seat. In Iowa, which Barack Obama carried in 2012, Trump’s poll numbers have consistently bettered Clinton’s. He is ahead by 3.7 percentage points in the latest RealClearPolitics poll average.

Republicans also have their eye on the Democratic-controlled House in Kentucky, another presumed Trump state. The Kentucky House, which Democrats hold by a seven-seat margin, is the lone legislative chamber in the South not controlled by Republicans.

Governorships are often isolated from national trends; incumbent governors have won 34 of 37 contested elections in presidential years since 1992. But this year seven of the 12 governorships are open races without an incumbent, three of them held by Democrats and four by Republicans.

The incumbent governor most in danger in 2016 is North Carolina Republican Pat McCrory (pictured, at right), who trails Democratic Attorney General Roy Cooper by 1.4 points, a statistical tie, in the latest RCP poll average. Offsetting this possible Republican loss is a GOP opportunity in Vermont, where unpopular Gov. Peter Shumlin (D) retired. Lt. Gov. Phil Scott (R) and former state transportation chief Sue Minter are statistically tied in the latest poll.

Montana probably presents Republicans with their best chance of upsetting a sitting Democratic governor. Although incumbent Steve Bullock leads narrowly in recent polls, software mogul Greg Gianforte, the GOP challenger, recently sunk $5.1 million of his own money into the race. That buys a lot of television in The Treasure State.

Overall, however, Democrats appear to have better prospects than the GOP at the state level. The outcomes are likely to depend on turnout, which could be depressed among Republicans, and get-out-the-vote efforts, on which Democrats have a significant advantage on paper.

Statehouse outcomes get scant media attention in comparison to presidential and congressional elections. But what happens in the states matters.

During the past six years, divided government in Washington has produced a stalemate on domestic policy. Meanwhile, Republican dominance in the states has achieved results—particularly in the 23 states where the GOP controls the governor’s office and both chambers of the legislature. Many of these states have cut taxes and spending, imposed restrictions on abortion, passed strict voter identification laws and carried out other items on the Republican agenda.

Democrats have also imposed their will in the seven states where they hold both the governorship and the legislature. California and Hawaii, for instance, have passed far-reaching mandates for alternative energy use that go well beyond the proposals of the Obama administration.

Hillary Clinton is an odds-on favorite to win the presidency. The Democrats are also slightly favored to win the Senate, although that is far from certain. But with the House of Representatives likely to remain in Republican hands, continued divided government is expected to prevail in Washington.

In this context, state governments will take the lead in determining national policy.