Federal judges in North Carolina have struck down state Republicans’ highly gerrymandered North Carolina congressional map as unconstitutional. The ruling could cost the GOP House seats in November’s midterm elections if the Supreme Court doesn’t delay the decision by the Supreme Court because of other redistricting cases it’s currently considering.

A three-judge panel ruled on Tuesday that Republicans had illegally gerrymandered the state’s map to their advantage.

This is not the first time courts have thrown out North Carolina’s congressional map. In May 2017, the Supreme Court declared it an illegal racial gerrymander, a violation of the Voting Rights Act. Tuesday’s ruling went much further, arguing that the congressional map violates the equal protection clause of the Constitution, as well as the First Amendment and Elections Clauses.

The district court’s decision may be stayed by the Supreme Court, which is currently considering a pair of cases to determine whether or not extreme partisan gerrymandering is unconstitutional.

According to Tuesday’s ruling, however, North Carolina’s Republican-controlled statehouse must redraw the map with weeks to spare before the 2018 elections, or the court will appoint a special master to do it for them. If the Supreme Court upholds that part of the ruling, Democrats could see a huge boost—they currently only hold three of the swing state’s 13 congressional seats.

More litigation is likely to come before it’s clear what will happen to North Carolina’s congressional map, but the ruling is the latest blow to gerrymandering—and potentially to Republican control of the House, which is built partly on a series of gerrymanders in large swing states like North Carolina, Pennsylvania, Michigan and Ohio, as well as Wisconsin, whose maps are currently in front of the Supreme Court.