On Monday, Pennsylvania’s state Supreme Court dealt Republican gerrymandering a crippling blow when it struck down the GOP’s congressional map for illegally discriminating against Democratic voters. The court has ordered the GOP-controlled legislature to draw and pass a new map by Feb. 15, in time for the 2018 elections, but Democratic Gov. Tom Wolf will certainly veto any new gerrymander if Republicans attempt one. If that were to happen, the court itself would draw new nonpartisan districts, which could lead to major Democratic gains this fall—anywhere from one to as many as six seats. And even better, the U.S. Supreme Court will likely have little leeway to overrule this decision.

As shown in the first map at the top of this post (see here for a larger version), Republicans passed an extreme gerrymander following the 2010 census that enabled them to obtain a 13-to-5 majority in the state’s congressional delegation, even though Pennsylvania is an evenly divided swing state. That lopsided distribution of seats held up in 2012 even as Obama won the Keystone State—and Democratic House candidates won more votes than Republicans statewide—and again in 2016, when Donald Trump barely carried it. As we have previously detailed, the second map shown above illustrates what a hypothetical nonpartisan map might look like, which would not only make for a more equitable partisan balance but also increase black representation.

In an important backdrop to this decision, Democrats won a pivotal majority on the state Supreme Court in the 2015 elections, giving the plaintiffs a fair shot at invalidating the GOP’s map. And crucially, this legal challenge relied solely on the state constitution’s guarantees of free speech and equal protection rights. Thus, as long as any new maps comply with federal law, the U.S. Supreme Court would have very little ability to override the state court’s interpretation of Pennsylvania’s own constitution. Democrats therefore aren’t likely to face the same kind of disappointment they recently did in North Carolina. Nevertheless, Republicans say they will still try to wage a long-shot appeal.

At the same time, because it’s based on state law, this ruling doesn’t set a legal precedent for other states. However, the standard the judges have established could influence federal courts that are hearing challenges to other partisan gerrymanders; plaintiffs in major cases in Maryland, North Carolina, and Wisconsin are all attempting to invalidate similar gerrymanders in their states under the U.S. Constitution. This ruling could also encourage reformers to challenge maps elsewhere under their own state constitutions.

Ultimately, this ruling is a monumental victory against one of the worst Republican gerrymanders in the country, and it’s a massive game-changer for Democratic chances of gaining a House majority in November.