The last time North Carolina Republicans redrew the state’s 13 congressional districts, they made absolutely no secret of their ambition to rig the system and lock in a 10-3 balance in their favour – regardless of whether they or the Democrats won a majority of the votes in future elections.

“I think electing Republicans is better than electing Democrats,” bragged the chair of the redistricting committee in the state general assembly, David Lewis. “So I drew this map to help foster what I think is better for the country.”

Drastic improvements in mapping technologies and voter information databases meant specialist mapmakers had unprecedented power to manipulate political outcomes, even in a swing state like North Carolina where one would ordinarily expect to see US House and state legislative seats split more or less evenly between the two parties.

The instruction from Lewis and his colleagues, according to court documents, was “to create as many districts as possible in which GOP candidates would be able to successfully compete for office”.

That was in 2016, when the prevailing wisdom across the US was that partisan gerrymandering was one of the legitimate spoils of American politics. Up to that point, the courts had punished gerrymandering along racial lines – one North Carolina map from the 1990s that packed black voters into the fewest possible districts was memorably likened to “political apartheid” – but raised little or no objection to state maps that favored one party over another.

That may be about to change dramatically, in the wake of a bombshell ruling from a federal court in North Carolina last week that found the 2016 redistricting plan to be a violation of both the constitution’s equal protection clause and an infringement on the free speech of voters who cannot meaningfully cast a ballot if the outcome is all but predetermined.

The court ordered the legislature to come up with new, fairer maps within two weeks and said if they did not, a court-appointed expert would redraw the maps for them.

The ruling, most of it supported unanimously by two liberal justices and one conservative, was widely seen as breaking new legal ground and could – if it is not stayed or overturned – make it significantly easier for the Democrats to retake control of the House of Representatives in this November’s midterm elections.

The ruling also picked up on a growing disquiet among justices on the US supreme court, who have questioned whether the political system is sustainable without the core principle that “voters should choose their representatives, not the other way around”.

The supreme court is already considering two partisan gerrymandering cases – one from Wisconsin (run by Republicans) and one from Maryland (run by Democrats). It now seems likely that the North Carolina case will be included in the court’s deliberations and that a new overarching standard for drawing district boundaries will emerge before the court’s term ends in June.

“This is the first time ever that a congressional districting plan has been struck down as partisan gerrymander,” one of the plaintiff’s attorneys, Ruth Greenwood of the Campaign Legal Center, told the Guardian.

“If we are able to keep that precedent, it could be applied to half a dozen other states.”

‘Sociological gobbledegook’?

Not everyone gerrymanders. In the complex patchwork of America’s political landscape, there are states that delegate redistricting to independent commissions and states where one party is so dominant there is no incentive to gerrymander.

Some of the worst offenders, however, are also some of the most important states in presidential elections – among them Wisconsin, North Carolina, Florida and Pennsylvania – which often hold the key to control of the House of Representatives too.

Supreme court chief justice John Roberts leads a panel interested in – but divided on – gerrymandering cases. Photograph: Evan Vucci/AP

Several times over the past 20 years, the Democrats have won more votes for House seats than the Republicans but ended up in the minority. The same has been true of state legislatures – most recently in Virginia, where the Democrats beat the GOP by 9% in races for the state House of Delegates in 2016 but won only 49 of 100 seats.

While other factors have played a role – most notably, the clustering of Democrats in urban districts, leading to a more inefficient distribution of their votes – gerrymandering has effectively received a turbo boost because of digital mapping technologies and significantly altered both the political and the legal landscape.

Justice Anthony Kennedy, expected to be the swing vote on the supreme court, has been open since at least 2004 to the idea that partisan gerrymandering could one day become so sophisticated as to be constitutionally intolerable.

And while some of his colleagues appear hostile to statistical analyses measuring the precise extent of partisan interference in district mapping – chief justice John Roberts called such analyses “sociological gobbledegook” when the Wisconsin case came up for oral argument in October – the North Carolina case presents a welter of new evidence and legal arguments to consider.

“North Carolina may present a set of facts that give the supreme court the hook they are looking for,” another of the plaintiff’s lawyers, Kathay Feng of Common Cause, told the Guardian.

It is also helpful that Maryland is in the mix, because it means there are plaintiffs from both major parties and the supreme court is at least partly insulated from the charge that they are responding to complaints from partisan sore losers.

“Justice Kennedy cares a lot about the court’s role in upholding a standard of laws that is not seen as tipping the scales in favor of one party or another,” Feng said.

Many questions remain about timing. The North Carolina state legislature was widely expected to appeal last week’s ruling but did not do so immediately. It is also unclear, even if the supreme court issues new standards, if these would impact the 2018 midterms or would be held over for enforcement until 2020.