Slate’s expanded voting rights coverage is made possible by the support of Slate Plus members and readers like you.

North Carolina Republicans have spent the last eight years ruthlessly undermining democracy in their state. The key to their extraordinary success is a series of partisan gerrymanders that dilute the power of Democrats’ vote, allowing the GOP to maintain a firm grasp on the state legislature. But Republicans failed to subvert the one institution capable of reversing this damage to fair representation: the state judiciary. Now voting rights advocates are poised to score a legal victory in North Carolina that could wipe out the GOP’s legislative gerrymander—with the help of civil rights attorney Anita Earls, who was elected to the state Supreme Court last week. The case could give Democrats a real shot at retaking the legislature in 2020, or at least contesting it on an even playing field.

Prior to the 2010 election, the Republican State Leadership Committee created Project REDMAP, a two-part plan to implement gerrymanders in purple states following the 2010 census. North Carolina, a traditionally moderate and bipartisan state, was a main target. First, the RSLC, aided by conservative mega-donor Art Pope, funneled money into legislative races to swing control of the General Assembly. It worked: In 2010, Republicans seized control of both the North Carolina House and Senate for the first time since 1870.

Next, Republican legislators worked with a team of GOP operatives and redistricting experts led by Tom Hofeller, the party’s chief gerrymander strategist. Holed up in GOP headquarters, using computers owned by the Republican National Committee and software licensed by the Republican Party, this group drew maps designed to entrench Republicans’ legislative power. (The public was not permitted to observe the process, though Pope was.) Hofeller later acknowledged that the plans were “designed to ensure Republican majorities in the House and Senate.”

Republican legislators then voted to approve the maps over unanimous Democratic dissent.* They worked as intended. Over the next three elections, Republicans won only a slim majority of votes statewide—yet secured a supermajority of seats in the House and Senate. After voters replaced Republican Gov. Pat McCrory with Democrat Roy Cooper in 2016, GOP legislators used their supermajority to strip Cooper of executive authority and further curtail voting rights.

In November 2016, however, a federal court found that 28 legislative seats constituted a racial gerrymander in violation of the Equal Protection Clause and ordered them re-drawn. The U.S. Supreme Court affirmed that decision in 2017. Republicans promptly attempted to replace this racial gerrymander with a partisan one, once again hiring Hofeller for the job. Hofeller used election data as a decisive criterion and produced a new map that flagrantly favored Republicans. Rep. David Lewis, who oversaw the committee in charge of the maps, explained his redistricting philosophy this way: “I think electing Republicans is better than electing Democrats.”

Voting rights advocates sued again, alleging that four of the new districts were still racially gerrymandered. The federal court agreed and ordered those districts—but only those districts—re-drawn. Today, this map remains in place, maximizing a GOP advantage across the state. It mostly held fast in the 2018 election, in which Democrats broke Republicans’ supermajority but failed to come close to taking control of either chamber.

On Tuesday, one week after the midterm election, Common Cause and the North Carolina Democratic Party brought a lawsuit on behalf of multiple voters in the state alleging that the current partisan gerrymander is unlawful under the state constitution. Their complaint illustrates, in painstaking detail, how GOP mapmakers “packed” Democratic voters into a handful of deep-blue districts, then distributed the remainder of Democrats across safe Republican districts, where their votes wouldn’t matter. They “cracked” cities into multiple mangled districts, pulling in rural Republican regions to diminish Democratic votes. Here are a few egregious examples of this practice:

• Mapmakers drew a “Wilmington notch” that absorbs the city’s most liberal neighborhoods into an otherwise rural Republican Senate District 9, preventing progressive voters from electing a Democrat.

• They also added a “tentacle” to Senate District 15, a Republican district that absorbs north Raleigh’s Democratic voters, thereby neutralizing their vote. At one point, the tentacle consists of nothing more than a Costco.

• Another GOP district, Senate District 41, begins north of Charlotte, cuts through an area west of Charlotte, then curls around to collect Republican neighborhoods south of Charlotte. It is stitched together by a small nature preserve at one point and by a tiny train station at another.

These maneuvers, along with many others, minimize the impact of Democratic votes, preventing North Carolina Democrats from transforming electoral support into legislative representation.

The practice dilutes the power of Democratic votes, stripping voters of their right “to vote on equal terms.”

Unfortunately, the U.S. Supreme Court is unlikely to strike down partisan gerrymanders following Justice Anthony Kennedy’s retirement. But the plaintiffs did not file their lawsuit in federal court. Instead, they filed in state court, alleging a violation not of the federal Constitution, but of the North Carolina Constitution. They have a very strong case. The North Carolina Constitution’s Equal Protection Clause is more robust than its federal counterpart, guaranteeing citizens “substantially equal voting power” and “the right to vote on equal terms.” It also commands that “[a]ll elections shall be free”—that is, not manipulated by the state to predetermine the outcome. And it safeguards freedom of speech and assembly beyond what the First Amendment provides.

All these constitutional rights, the plaintiffs argue, should prohibit the legislature from engaging in such egregious partisan gerrymandering. The practice dilutes the power of Democratic votes, stripping voters of their right “to vote on equal terms.” It prevents elections from being truly “free” by rigging the outcome in favor of the ruling party, as the Pennsylvania Supreme Court recently ruled in a similar case. And it infringes upon voters’ freedom of expression by discriminating against those who associate with a certain political party. In fact, Republican mapmakers “retaliated” against Democratic voters on the basis of political affiliation, unlawfully burdening their “associational rights” enshrined in the state constitution.

The plaintiffs stand an excellent chance of winning. This case will ultimately be decided by the North Carolina Supreme Court—and the judiciary is the one branch of government largely uncorrupted by GOP chicanery. In 2016, Democrat Michael R. Morgan won a seat on the court, creating a 4–3 majority. Republicans responded by attempting to rig the 2018 election in favor of a Republican incumbent, Justice Barbara Jackson. They abolished judicial primaries, hoping that multiple Democrats would run against Jackson, splitting the liberal vote. Instead, a lawyer named Chris Anglin ran as a Republican, creating a three-way race between Jackson, Anglin, and the Democratic candidate, civil rights attorney Anita Earls. Republicans tried and failed to knock Anglin off the ballot. And on Election Day, Anglin and Jackson split the GOP vote, handing the election to Earls.

As a result, Democrats will soon hold a 5–2 majority on the court. And Earls played a major role challenging earlier GOP gerrymanders. When she announced her candidacy, Earls declared that she sought to shield “the right of all citizens to cast a ballot that is counted equally,” a clear reference to partisan gerrymandering. There is no reason to doubt that she and her Democratic colleagues on the court will be prepared to invalidate the current legislative maps when this case reaches their docket.

Notably, the plaintiffs did not challenge North Carolina’s congressional gerrymander, which gives Republicans 10 of the state’s 13 seats in the House of Representatives. That’s because a federal court has already struck down that map under the U.S. Constitution, and the case will be heard by the U.S. Supreme Court next year. Voting rights activists will probably lose at SCOTUS. But once they do, they can return to North Carolina and file a similar suit in state court. There, they may succeed in time for the North Carolina Supreme Court to mandate a new House map for the 2020 election. North Carolina Democrats might therefore win more seats in the House of Representatives and regain control of the General Assembly—all thanks to the demise of GOP gerrymanders.

For nearly a decade, rigged maps undermined North Carolina’s democracy. The state constitution may soon restore it, thanks in no small part to the ballots of North Carolina voters last week.

Update, Nov. 14, 2018: This article has been updated with the names of specific state Senate districts gerrymandered by North Carolina Republicans. *Correction, Nov. 13, 2018: An earlier version of this article misstated that Republicans approved gerrymandered maps over unanimous Democratic consent. They approved the maps over unanimous Democratic dissent.