For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

The Supreme Court ruled on Thursday that partisan gerrymandering cannot be challenged in federal court. The decision is a devastating blow to voters in gerrymandered districts, as well as the voting rights advocates who have been working for years to rein in extreme gerrymandering that benefits one party.

But the court’s conservative majority, in a 5-4 opinion by Chief Justice John Roberts, found Thursday that drawing maps to help one party remain in power presents “political questions beyond the reach of the federal courts.”

The ruling addressed challenges to partisan gerrymandering in Maryland and North Carolina. In both cases, the party in power drew districts to disadvantage its political opponents. In Maryland, Democrats dismantled a Republican-held congressional seat to gain a 7-1 advantage in Congress, while in North Carolina, Republicans drew a map that gave them a 9-3 advantage in the congressional delegation. (The North Carolina map was drawn by Thomas Hofeller, the GOP’s longtime redistricting mastermind who was also behind the Trump administration’s addition of a citizenship question on the 2020 census.)

Now, both maps will be left in place. Going forward, parties in power in state legislatures across the country will be given free rein by federal judges to entrench their own power through political map-drawing.

The ruling comes at a pivotal time: The 2020 elections will determine who controls the state legislative bodies that in most states will draw new district lines in 2021, following the 2020 census. These cases were the last chance for the Supreme Court to curb partisan gerrymandering before the next election. By ruling that partisan gerrymandering is beyond the reach of the courts, Thursday’s decision virtually ensures that the maps passed in 2021 will be even more extreme than in 2010.

It was the latest blow to voting rights from a Supreme Court that has gutted the Voting Rights Act (in an opinion by Roberts) and upheld strict voter ID laws, voter purging, and racial gerrymandering.

“In giving such gerrymanders a pass from judicial review, the majority goes tragically wrong,” Justice Elana Kagan wrote in a dissent. “Election day—next year, and two years later, and two years after that—is what links the people to their representatives, and gives the people their sovereign power. That day is the foundation of democratic governance. And partisan gerrymandering can make it meaningless. At its most extreme—as in North Carolina and Maryland—the practice amounts to ‘rigging elections.’”

Though both parties have done their fair share of gerrymandering, Republicans did it in far more places over the past decade. In 2010, Republicans took control of nearly every major swing state and oversaw the redistricting process for four times as many state legislative seats as Democrats, giving them a virtual lock on power for the remainder of the decade. Republicans were able to hold onto an additional 16 congressional seats and seven state legislative chambers in 2018 because of these skewed maps, according to an Associated Press analysis.

Voters are already fed up with gerrymandering across the country. Just last year, voters in five states approved ballot initiatives to turn over the redistricting process to independent commissions. (Ironically, Roberts pointed to these commissions as a solution to the problem, but voted to gut Arizona’s independent redistricting commission in a case from 2015.) Lower courts have increasingly struck down gerrymandered maps in states like North Carolina, Wisconsin, Ohio, and Michigan. But for years the Supreme Court has been unwilling to address partisan gerrymandering. Now, the court has gone even further, taking away the ability of voters in states where their votes are rendered meaningless to fight those maps in federal court. Voters can still go to state court, depending on the laws of their state.