Democrat Sheila Bynum-Coleman is challenging Virginia House Speaker M. Kirk Cox (R) in a newly redrawn district, one of many key races that will help decide the balance of power in Congress for the next decade. (John McDonnell/The Washington Post)

For the first time in 20 years, Democrats are entirely on the offensive in state legislative battles just before a redistricting cycle — and just in the nick of time for the future of their party.

This is the last election cycle before redistricting could lock them out of power in key states for another decade — and severely hamper their ability to keep their majority in the House.

After losing nearly 1,000 seats during the Obama years, Democrats need to win back as many state legislatures as possible by the end of next year before states redraw their state and congressional election districts based on new 2020 census population data.

To that end, Democrats’ state legislative campaign arm, the Democratic Legislative Campaign Committee, is racing to pick up as many as eight to 10 chambers to add to the eight they flipped from Republicans in the 2018 election cycle. They’ve raised $10 million already, which is a record for them and more than they spent in the whole 2010 cycle, when Democrats got wiped out of power in many states. What’s more, Democrats are set up well not to lose any chambers for the second election cycle in a row.

“We have never been this well positioned in modern campaign times,” said Jessica Post, president of the DLCC.

In other words, donors and leaders in the Democratic Party have finally caught on to what Republicans have known for years: If you control state legislatures, you have the power to control Congress via the power to draw the congressional districts every 10 years.

Republicans have controlled most of the legislative map-writing for this century. They really put the pedal on the gas in 2010 state elections, where they poured millions into flipping legislative chambers with the expressed goal of drawing the district maps. (In most states, legislators draw maps based on new census data every decade, as opposed to commissioning this out to an independent group.)

Republicans’ strategy worked beautifully. In one election, they flipped more than 20 chambers, and they kept their momentum up for the next few cycles. Largely as a result, Democrats were locked out of control of the House for eight years.

Even a decade later, Democrats are at such a deficit of power today that they could be locked out of power in some battleground states to control redistricting — Florida, Ohio, Wisconsin — no matter how stellar a 2020 election they have.

“It’s not hard to be enthusiastic about the gains you can make when you’re at rock bottom,” said Dave Abrams, communications director for the Republican State Legislative Committee, pointing out that Republicans hold close to a record of state legislative chambers: 61 of 99. Public fundraising reports show that Democrats’ state legislative elections arm slightly outraised Republicans’ in 2019, which hardly ever happens. Abrams declined to share to-date fundraising data but said: “The RSLC will have the resources, infrastructure and organization to support them.”

It wasn’t until Democrats’ disastrous 2016 election, when the GOP won control of all of Washington, too, that they realized what a dire situation they were facing ahead and how little time they had left to fix it. After Barack Obama left the White House, his former attorney general started the National Democratic Redistricting Committee to call attention to the plight.

“After 2016, we started a national conversation about how you need to rebuild the party from the ground up,” Post said.

Some Democratic operatives are worried that history could repeat itself in 2020; that all their party’s money would go to the presidential race rather than granular state legislative battles, which, while small, in some states can have more impact than who’s in the White House.

“There will be justifiably a lot of attention paid to defeating Donald Trump,” said Carolyn Fiddler, communications director for the left-leaning political blog Daily Kos and former DLCC staff member, “but Democrats can’t afford to focus on that at the expense at these down-ballot races if they care anything about this next decade.”

In November and in 2020, Democrats will have the potential to take chambers from Republicans in Virginia, Arizona, Michigan, Minnesota, Pennsylvania, North Carolina, and even Iowa and Texas — and they have their eyes on even more chambers they could take in a wave year. Having a lever of power in many of these states is crucial for Democrats if they want to try to have a congressional majority, too.

The redistricting stakes for Democrats are particularly acute in North Carolina and Texas. In those states, Democrats have no authority in the map-drawing process because Republicans control both state legislatures. (The governor of North Carolina is a Democrat, but unlike in many other states, he doesn’t have the authority to veto a legislature’s electoral maps. He’s also facing a tough reelection battle.)

In Texas, a wave of Republican congressional retirements could help Democrats pick up House seats, which would go a long way toward helping House Democrats keep control of Congress.

But those gains could almost immediately be eliminated the next year by Republican-led redistricting. To prevent that, Democrats need to flip nine legislative seats to win the Texas state House — which is as close as they’ve ever been since the realignment of political power in the South.

In Virginia and Pennsylvania, courts recently threw out Republican-drawn maps. That means the speaker of the House in Virginia now must run for reelection in a Democratic-leaning district. Virginia Democrats are two seats away in each chamber from controlling both the legislature and the governor’s mansion, which means they could have a chance to solidify maps that are more favorable to Democrats for the next decade.

The urgency for Democrats to win back state legislatures before it’s too late is exacerbated by a recent Supreme Court ruling that kneecapped what seemed a promising avenue for Democrats to knock down Republican-drawn maps. In June, the Supreme Court decided that federal courts have no say in whether it’s okay for lawmakers to draw their electoral districts for partisan reasons. That meant federal lawsuits had to be dropped in Wisconsin and North Carolina against Republican-drawn maps. (And one against a Democratic-drawn map in Maryland, because both sides gerrymander.)

“We’re still paying the price for getting wiped out in 2010,” said Matt Harringer, communications director for the DLCC.

Democrats may never completely regain parity, much less control, in some states. But they feel as though they are finally well positioned to at least recover their 2010 losses before they are cemented in redistricting maps for another decade.