Democrats spending millions to try to take back statehouses in Florida, Texas and other key states.

AUSTIN, Texas (AP) — Democrats still shaken by the 2010 tea party wave that netted Republicans six governors’ offices, flipped 21 statehouse chambers and drove nearly 700 Democratic state legislators from office are mounting a comeback, pouring millions of dollars into state level races.

In a longtime Republican district covering a wealthy enclave of Dallas, Democratic challenger Shawn Terry has raised $235,000, an eye-popping amount for a statehouse race that’s more than a year away. In Virginia, where the GOP holds a slim majority, Democrats have outraised Republicans for the first time in years. Democrats are even putting some money in deeply Republican Louisiana.

The cash deluge shows how the consequences of next year’s elections run far deeper than President Donald Trump’s political fate. The party that controls state legislatures will take a leading role in the once-in-a-decade redistricting process that redraws congressional maps. Newly empowered Republicans used that process to their favor following the tea party victories, and Democrats want to use the same playbook.

“There is, especially for this cycle, a very strong focus on redistricting,” Terry said.

The stakes are particularly high following a recent Supreme Court ruling that decided federal courts have no business policing political boundary disputes in many cases. The ruling doesn’t apply to districts gerrymandered along racial lines but otherwise gives states wide latitude to draw maps with little concern for an eventual judicial rebuke.

“Everybody knows everything is at stake,” said Stephanie Schriock, president of the group EMILY’s List, which recruits and trains women to run for office and plans to spend $20 million on legislative races. “We just have to go in and win chambers.”

Organizations like EMILY’s List, the Democratic Governors Association and the Democratic Legislative Campaign Committee have seen a sharp increase in donations, nearing parity with Republicans who almost always outraise and outspend them, according to an analysis of IRS data by The Associated Press.

And Democratic donors who gave little to nothing to down-ballot races in the past are cutting large checks to groups focused on state races, the AP’s analysis shows. Among them are billionaire George Soros (at least $5.4 million), hedge fund billionaire Donald Sussman (at least $4.8 million) and billionaire investor and entrepreneur Fred Eychaner (at least $4.2 million).

The numbers don’t take into account the activities of nonprofit “dark money” groups that both Republicans and Democrats operate. They won’t have to disclose their finances until next year at the earliest.

But already the money is filtering out to the states.

Priorities USA, the largest Democratic outside group, and EMILY’s List recently announced they would spend $600,000 on voter mobilization for Virginia’s fall elections. For the first time, the Democratic opposition research group American Bridge is digging into the pasts of Republican statehouse candidates.

And the DLCC, which is spearheading efforts in Virginia, says it has collected $9 million since the 2018 midterm elections, an off-year record, and is on pace to reach its $50 million fundraising goal for the cycle.

New groups that are focused on state races have sprung up, including the National Democratic Redistricting Committee, which is led by former Attorney General Eric Holder and endorsed by former President Barack Obama.

It all stems from what Democrats describe as a nearly traumatizing experience in 2010 when, reveling in the early days of the Obama administration, they failed to organize at the state level. Democratic strategist Jessica Post remembers being outside a bar in Pennsylvania’s capital city of Harrisburg when she got word of just how thoroughly her party was rejected.

“After curling up on the sidewalk, I walked back into the bar, popped open a Budweiser and said to myself, ‘If I have anything to do with this, we will not get outclassed in 2020 by the Republicans,’” said Post, who now leads the DLCC and is tasked with reclaiming lost ground.

The new attention Democrats are paying to down-ballot races is a break from the past, when the White House and Congress were the primary focus. Former Virginia Gov. Terry McAuliffe said a breakthrough came in 2016 when he, then-House Minority Leader Nancy Pelosi and other party officials gathered top Democratic donors in a Philadelphia hotel ballroom to forcefully make the case and unveil a new state level fundraising initiative.

“People finally understand that you just can’t play every four years in the presidential, you have to play in these state races,” said McAuliffe, a top Democratic fundraiser. “You could have a great wave in Congress, but if you have all these gerrymandered districts, I don’t care how much money you have.”

Next year’s elections will still play out under the maps that Republicans drew after the 2010 campaign. But Democrats are hoping that the money they’re investing in state races, higher turnout in a presidential election year and frustration with Trump, particularly in the suburbs, could give them the lift they need.

In Texas, for instance, Democrats are nine seats away from flipping the House, which would give them a sliver of power after nearly a quarter-century of political irrelevance. A Democratic majority in the House would deny the GOP the chance to write congressional maps on their own.

The Minnesota Senate is one seat away from flipping from red to blue, while the Michigan House is four seats away, according to figures from the National Conference of State Legislatures. Pennsylvania Democrats need nine seats to control the House and five to take the Senate. In Florida, Democrats are four seats from power in the Senate, while control of the Wisconsin Senate hangs by three. In North Carolina, Democrats could take the Senate by winning five seats, while the House would require them to flip six.

Republicans are taking the threat seriously. Citing multiple studies, they say the outcomes of 50 legislative races across the U.S. could be the difference between a 36-seat Republican congressional majority and a massive 110-seat Democratic edge.

Austin Chambers, president of the Republican State Leadership Committee, said his organization will need to raise more than it ever has, though he declined to state a fundraising goal. His group was narrowly edged by DLCC in the first half of 2019, though Chambers said he expects they will ultimately outraise Democrats.

“It is serious as a heart attack, and we’ve got to do everything we can to prepare for it,” he said.