Over the years, North Carolina has been consumed with numerous changes to political boundaries, legal challenges and associated vitriol. Democrats have accused Republicans of racism and drawing lines to minimize minority votes. And Republicans have accused Democrats — who effectively ran the state for decades — of hypocrisy, noting that they, too, actively engaged in gerrymandering once upon a time.

[Why the Trump administration is running out of time to print the census.]

“Everyone’s against gerrymandering when they’re not the ones in power,” Mr. McCrory said.

The state’s current governor, Roy Cooper, said in a statement that the “battle is far from over,” noting that the fight against extreme partisan gerrymandering now moves to the courts and voters.

[How the Supreme Court decided that partisan gerrymandering was not barred by the Constitution.]

The state’s emergence in recent years as one of the most active battlegrounds in America’s voting wars stems to 2010, when Republicans gained control of both houses of the state legislature for the first time in a century, giving them the power to redraw all manner of political maps.

There was a feeling then among Republicans that old wrongs needed to be righted, and that the state needed a firm rightward shove to bring it in line with the party’s wave that had overtaken much of the South. But they were met with fierce resistance from a liberal contingent that is one of the best organized in the region.

“They have been pursuing a very, very aggressive policy agenda that in some ways has kind of been like a lab experiment for what Trump has been pursuing on the national level,” said Rob Schofield, director of NC Policy Watch, a liberal group. “The gerrymandering has provided an environment where that lab experiment can continue to thrive, even though it is a divided purple state.”