Washington (CNN) Democrats made massive gains in statehouses in Tuesday's midterm elections, reversing an imbalance that had grown under former President Barack Obama's tenure and given Republicans much more power at the state level.

Though ballots are still being counted in some states and recounts are possible in close races, Democrats appear on track for a net gain of about 300 state legislative seats.

The party also claimed seven governors' offices that had been in Republican hands, winning races in Illinois, Kansas, Maine, Michigan, Nevada, New Mexico and Wisconsin.

The victories got little national attention but have major implications for 2020's presidential election and for the next decade in Congress. Most state legislatures draw district lines, an authority Republicans used to cement their House majority for the last eight years.

The wins mean Democrats now control the governorships of Wisconsin, Michigan and Pennsylvania -- the three "blue wall" states that delivered Donald Trump the presidency in 2016.

Read More