The plan worked extremely well. In 2012, Republicans won just 49 percent of the statewide vote but snagged nine of 13 House seats. Two years later, with 54 percent of the vote, they won 10 of 13 seats. But a lawsuit against that plan argued that the Republican maps had actually been intended to dilute black votes, and a federal court struck the plan down in 2016. (The Supreme Court affirmed that decision last spring.)

Sent back to the drawing board—or, more precisely in this high-tech era, the drawing software—Republicans did not take a conciliatory stance. Instead, forbidden from using race, the GOP proudly used partisanship as their primary criterion in drawing new maps.

“I acknowledge freely that this would be a political gerrymander, which is not against the law,” said Representative David Lewis, the chair of the state House redistricting committee. He also said, “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.” And he suggested the committee draw maps that would produce 10 Republican and three Democratic U.S. House districts, on the basis that he didn’t think it would be possible to come up with an 11-2 map.

The court decision on Tuesday noted:

Legislative Defendants do not dispute that the General Assembly intended for the 2016 Plan to favor supporters of Republican candidates and disfavor supporters of non-Republican candidates. Nor could they … Legislative Defendants also do not argue—and have never argued—that the 2016 Plan’s intentional disfavoring of supporters of non-Republican candidates advances any democratic, constitutional, or public interest. Nor could they.

The decision to openly boast about a partisan plan was perhaps unwise, but it was not unfounded. No federal court had ever struck down a redistricting plan as an unconstitutional partisan gerrymander.

Nonetheless, Common Cause and the League of Women Voters both challenged the law, and their two suits were consolidated into one. The plaintiffs argued that the plan violated the Equal Protection Clause, because it discriminated against non-Republican voters; the First Amendment, because it discriminated against voters based on previous political expression; and Article I, because it interfered with the right of the people to elect their representatives.

They brought novel statistical models to demonstrate how slanted the plan was. In particular, the plaintiffs focused on the “efficiency gap,” which measures how many votes for a candidate are wasted—either the number of votes in excess of what the candidate needs to win, common when voters backing a candidate are packed into a district, or the number of votes cast for the loser, when that candidate’s supporters are dispersed. Additionally, in a simulation of all possible North Carolina congressional maps, a Duke mathematician found that an 11-3 GOP split occurred just 0.7 percent of the time.