On Tuesday, a federal district court made history by striking down North Carolina’s congressional map. The decision marks the first time a court has invalidated a congressional redistricting scheme as illegally gerrymandering along partisan lines. It arrives at a critical moment for the development of a legal theory that requires federal courts to set limits on political redistricting. Tuesday’s rigorous ruling bolsters the constitutional case against partisan gerrymandering, which the Supreme Court may well affirm this year. It relies heavily on the writing of Justice Ruth Bader Ginsburg, who aided opponents of gerrymandering in a crucial but often overlooked 2015 opinion.

There’s no question that North Carolina Republicans manipulated their state’s congressional map to disfavor Democratic voters. The GOP legislator who helped to draw the current map, state Rep. David Lewis, openly declared that the scheme constituted “a political gerrymander,” explaining: “I think electing Republicans is better than electing Democrats. So I drew this map to help foster what I think is better for the country.” Lewis also admitted that he used “political data in drawing this map” for the sole purpose of “gain[ing] partisan advantage,” his ultimate “goal.” He succeeded, giving Republicans an advantage in 10 out of the state’s 13 congressional districts—while noting that he would’ve preferred “to draw a map with 11 Republicans and two Democrats.”

Voting rights advocates sued, alleging that GOP mapmakers had violated the Constitution’s free speech, equal protection, and election clauses by discriminating against Democratic voters on the basis of their political association. The Republican-controlled redistricting committee could not plausibly deny its motives in light of ample evidence proving partisan intent. But it still insisted that its map was lawful, asserting that legislators are allowed to favor their own party in redistricting.

There’s no question that North Carolina Republicans manipulated their state’s congressional map to disfavor Democratic voters.

Is that true? The Supreme Court will soon decide—and not a minute too soon, because its gerrymandering jurisprudence is a bit of a mess. In 1986, a badly splintered court found that partisan redistricting could run afoul of the Constitution, but failed to articulate when it might cross a legal line. Then, in 2004, a fractured court held that political gerrymandering is probably unconstitutional—but might not be resolvable in federal court. There was no majority opinion in either case, leaving the lower courts without clear guidance in gerrymandering disputes.

In 2015, however, Ginsburg seized upon a tangential case, Arizona State Legislature v. Arizona Independent Redistricting Commission (AIRC), to strike a surreptitious jurisprudential blow against political gerrymanders. AIRC did not involve a direct challenge to partisan redistricting. Rather, it was a challenge to an Arizona law, passed via ballot initiative, that stripped the legislature of its redistricting duties and delegated them to a non-partisan commission. In a 5–4 decision authored by Ginsburg, the court concluded that independent redistricting was a constitutionally permissible exercise of the people’s “legislative power.”

But Ginsburg did not stop there. In several remarkable passages, Ginsburg cast aspersions on partisan gerrymandering itself. The justice began her opinion by stating flatly that “partisan gerrymanders are incompatible with democratic principles.” She described political redistricting as a “problem” that “subordinate[s] adherents of one political party and entrench[es] a rival party in power.” And she pointed out that this practice contravenes “the core principle of republican government”—that “the voters should choose their representatives, not the other way around.”

Justice Anthony Kennedy expressed somewhat similar sentiments in a 2004 concurring opinion. But AIRC marked the first time that a majority opinion with precedential value would explicitly denigrate partisan gerrymandering as an undemocratic abomination. Writing in dissent, Chief Justice John Roberts dismissed the court’s barbs as “naked appeals to public policy.” But Ginsburg was not simply leaning on her own policy preferences. She was planting the seeds of a coherent jurisprudence that lower courts could use to strike down political gerrymanders.

Those seeds have now sprouted. In 2016, a federal district court invalidated Wisconsin’s state legislative map as an unconstitutional partisan gerrymander. The court used Ginsburg’s definition of political redistricting as its framework, focusing, as she did, on the “problem” of legislative entrenchment by the majority party. “It is safe to say,” the court wrote, “that this concept of abuse of power seems at the core of the court’s approach to partisan gerrymandering,” citing AIRC. The court then found that Wisconsin Republicans had, indeed, entrenched their own legislative dominance through unconstitutional redistricting. That case is now under review by the Supreme Court.

On Tuesday, the federal court that struck down North Carolina’s congressional map adopted a similar approach to the Wisconsin court.

In a decision that cites AIRC 18 times, the court adopted Ginsburg’s entrenchment principle as its analytical lodestar. Quoting Ginsburg directly, the court held that a state acts unlawfully when it redistricts with the intent to “subordinate adherents of one political party and entrench a rival party in power.” And here, the plaintiffs put forth “a wealth of evidence” to demonstrate Republicans’ intent “to ‘subordinate’ the interests of non-Republican voters” and “entrench” their own domination. Thus, the court explained, the congressional map qualified as an impermissible partisan gerrymander.

With this reasoning, the district court essentially turned Ginsburg’s AIRC analysis into a standard for gauging the legality of gerrymanders. The justice seized upon the case to throw the court’s weight behind a clear and concise conception of political redistricting that lower courts have already used to strike down egregiously partisan maps. If the Supreme Court soon clarifies that extreme partisan gerrymandering is unconstitutional, as it appears poised to do, Ginsburg will have laid the groundwork in AIRC. Her masterful opinion has already given lower courts the tools they need to restore democracy in states where it is under siege.