Democrats are increasingly optimistic that they can flip dozens of state legislative seats in Tuesday’s election, expanding the party’s clout in Midwestern and Southern states that have been at the forefront of Republican efforts to pass some of the nation’s most conservative policies.

The battle for more than 5,000 state legislative seats has been largely overshadowed by the contentious presidential and congressional elections, but the outcome has significant political consequences. Flipped legislatures would give Democrats a once-in-a-decade influence over redrawing congressional boundaries and would create “a wall of Democratic power” against the nation’s increasingly conservative federal courts, said Jessica Post, executive director of the Democratic Legislative Campaign Committee.

The DLCC is hoping to flip as many as seven legislative chambers this year, while eroding GOP majorities in such states as Florida and Wisconsin. In the final days of the campaign, Democrats have an edge to take majorities in the Minnesota Senate, the Iowa House of Representatives and both chambers of Arizona’s legislature, according to strategists in both parties and independent analysts, though races in other key states — including in Michigan, Pennsylvania, North Carolina and Texas — remain close.

Both parties are pouring millions of dollars into last-minute campaign ads amid the massive turnout for early voting, and top Republicans are sounding an alarm to rally their supporters to the polls.

“It’s absolutely clear that a decade of power is on the line with redistricting,” said Austin Chambers, president of the Republican State Leadership Committee (RSLC), which focuses on GOP state races. “But perhaps more importantly, most of the conservative policy that states have worked on over the last decade is on the line.”

Republicans control 59 out of 99 state legislative chambers, an advantage that has allowed them to enact restrictions on voting and abortion rights, block expansion of Medicaid and hinder some Democratic governors from imposing restrictions to combat the coronavirus pandemic. That dominance in state legislatures also gave the GOP the advantage in drawing favorable congressional boundaries following the 2010 Census.

With the next round of congressional redistricting set to begin next year, Democrats are making a major push to reshape the balance of power in state governments.

Democrats have flipped more than 450 state legislative seats since President Trump took office in 2017 and have taken control of 10 legislative chambers. Democratic Party leaders hope to build on those major gains Tuesday, increasingly looking to state houses to codify abortion rights and environmental protections, Post said.

But strategists in both parties say the Democratic efforts in several highly competitive states may fall short of handing them control of certain legislative chambers.

“We are super clear-eyed what is in front of us in this election,” Post said. “We think we have a great shot to pick up seats all around the country, but in many states, we will hit a wall of gerrymandering that makes picking up entire chambers more difficult than picking up seats.”

Despite Post’s reservations, it is Republicans who have grown anxious in recent days, even in some states where it appeared only a few months ago that their legislative candidates would sail to easy victories.

After watching voters stream into polling places in the increasingly Democratic suburbs of Atlanta, Chambers said Republicans are concerned that Democrats could make major gains in the Georgia House, where the GOP holds a 16-seat majority. Republicans are also in a “dogfight” to keep control of the Texas House, where Democrats are nine seats short of a majority, Chambers said.

“There are no two states right now that are more toss-ups up-and-down the ticket than Texas and Georgia,” said Chambers, noting that Republican Gov. Brian Kemp received less than 55 percent of the vote in 17 Georgia House districts in 2018. “I am still optimistic that we are going to hold both, but they are both absolutely toss-ups that are on the line.”

The uncertainty facing both parties comes as they have been trading accusations about who has the spending advantage in the final days of the contests, an especially important period for state legislative campaigns because many voters are only now familiarizing themselves with the candidates.

As of Saturday morning, Democratic state legislative candidates had raised $439 million, compared to the $344 million raised by GOP candidates, according to an analysis by the National Institute on Money in Politics, also known as FollowTheMoney.org.

But the RSLC has outraised the DLCC by about $15 million this year, which Post said may give Republicans a critical advantage. Chambers counters Republicans are the ones at a serious disadvantage because advocacy groups for gun control, the environment and voting rights are also spending heavily to back Democratic candidates.

Suburban communities remain a key target in Democrats’ battle for control of state houses. Post said the party’s private polls show Democratic presidential nominee Joe Biden ahead of Trump in nearly all of Democrats’ top suburban targets. Democratic strategists say their real advantage will come from their candidates’ focus on expanding access to health care and criticizing Republican governors’ responses to the pandemic.

“In these down-ballot races, you really need to make an actual point about the individual state house races and the candidates,” said Vicky Hausman, co-founder of Forward Majority, a liberal activist group that is spending $32 million on state legislative races in Texas, Florida, Arizona and North Carolina. “It’s not enough to just run on the environment of Trump.”

Some Republican candidates have campaigned on accusations that their Democratic challengers support defunding local police departments. They also have argued their party’s low-tax message is better suited to help pandemic-stressed state economies rebound.

“If we end up with a Democratic House and Republican Senate, and the Democratic leadership is too progressive, then nothing is going to get done in our state,” said Lorna Romero, an Arizona Republican consultant. She expects the GOP will retain its legislative majorities in Arizona due to suburban “ticket-splitters” who may vote for Biden or Democratic U.S. Senate candidate Mark Kelly but will stick with the GOP in state legislative races.

“Democrats are probably counting their chickens a little bit too early” she said.

Chaz Nuttycombe, founder of election forecasting site CNalysis, predicts that Democrats will pick up 40 state senate and 70 state house seats nationwide, potentially flipping the Minnesota Senate, the Iowa House, the Michigan House and both legislative chambers in Arizona. Nuttycombe favors Republicans to flip just one chamber, the Alaska House.

“Although there may be some better results for some Republicans further down the ballot, especially in these suburban districts, you are only going to find so much ticket-splitting,” said Nuttycombe, who is also a guest contributor for the political analysis website Sabato’s Crystal Ball at the University of Virginia Center for Politics.

A defining question for both parties is whether Democrats can pull off a major victory by winning control of the Texas House, breaking the grip on power that Republicans have held there for nearly two decades.

Matt Angle, founder of the Lone Star Project, a ­Democratic-aligned political action committee, said a Democratic victory would limit Republicans’ ability to enact some of the “most egregious legislative initiatives in the country.”

He noted Texas leaders passed legislation in 2017 allowing law enforcement officials to stop anyone whom they suspect of being an undocumented immigrant, slashed funding for women’s health clinics and have passed a raft of bills that restrict Texas cities from setting their own policy and spending decisions.

Texas’s congressional delegation, already the second biggest in the nation, will likely grow by an additional two or three seats after the 2020 Census. Angle said a Democratic House would force Republicans to draw congressional maps so that those newly added seats are used to represent heavily minority communities, which are the drivers of the state’s population growth.

Just as importantly, Angle says, a Democratic House — which he gives a “50-to-50 chance” — would provide a major morale boost for a party that most analysts were writing off as a relic of the state’s past a few years ago.

“In Texas, Republicans hold every megaphone and Democrats are just yelling out the window,” Angle said. “If you have a Democratic House and a Democratic speaker, they can finally be seen and heard.”

Correction: This story has been updated to correct the number of legislative chambers Democrats have taken since President Trump took office. Democrats have flipped control of 10 state legislative chambers since 2017, including eight in the 2018 midterm elections and two in Virginia in 2019.