Olivier Douliery / Getty

A federal court has delivered a big blow to partisan gerrymandering.

A panel of three judges struck down North Carolina’s 2016 congressional map as unconstitutional on Tuesday—the first time a federal court had done so as a result of a partisan gerrymander. The plaintiffs claimed that the gerrymandered map was in violation of both the First Amendment and the Equal Protection Clause. Judge James Wynn Jr. agreed, writing that the GOP-led state legislature had been “motivated by invidious partisan intent.” The court ordered the state’s General Assembly to redraw the boundaries by January 24.

The state has a history of drawing unconstitutional congressional borders. Last year, the U.S. Supreme Court ruled that two of North Carolina’s congressional districts, drawn in 2011, were racially gerrymandered. But it has not yet ruled on the constitutionality of partisan gerrymandering, which critics say subverts the will of voters by concentrating those of particular persuasions in certain districts.

The high court, however, has two such cases on its docket, one from Wisconsin and a second from Maryland. Chief Justice John Roberts has voiced concerns about the judicial branch wading into political territory, calling the issue “sociological gobbledygook.” However, swing vote Justice Anthony Kennedy is thought to be sympathetic to the argument that partisan gerrymandering is unconstitutional.