North Carolina Election Results 2018 MARGIN OF VICTORY Democrats won Republicans won +20 +15 +10 +5 +5 +10 +15 +20 *Note: In the Ninth District, the Republican candidate leads but the race is uncalled.

GREENSBORO, N.C. — When the blue wave came to North Carolina, the red levees held.

In a year in which Democrats picked up as many as 41 House seats elsewhere, including in places as conservative as Oklahoma and Utah, they appeared to lose all three of their targets for pickups in one of the nation’s most closely divided states. Democrats in North Carolina earned 48.3 percent of the total vote cast in House races but appeared to win only three seats; Republicans had 50.4 percent of the vote and won at least nine seats. (One race, in the Ninth District, originally called for the Republican candidate, remains uncertified because of questions about the legitimacy of some absentee ballots.)

The results, which left the partisan makeup of the state’s House delegation unchanged, were as much a triumph of mapmaking as campaigning. The election was held using gerrymandered district lines that federal judges had deemed unconstitutional; those lines were drawn because previous ones had also been deemed unconstitutional.

That only hints at the depth and ferocity of the battles over gerrymandering and voting regulations in North Carolina, where a Republican takeover of the General Assembly in 2010 set off a barrage of conservative legislation and rule changes that are still being fought in the courts.

In this, North Carolina is one conspicuous example of a critical story line in this year’s elections: the degree to which gerrymandering has created firewalls in key states that even a wave election may not be able to breach.

North Carolina and Ohio are two of the most gerrymandered states, said Michael Li, senior counsel in the Brennan Center for Justice’s Democracy Program. And in both of those states, Democrats failed to pick up a single House seat despite winning close to half of the popular vote. They hold only four of 16 seats in Ohio — and in the Ohio House, Republicans maintained a veto-proof supermajority with a bare majority of the popular vote.

By contrast, Pennsylvania, which voted under a new nonpartisan, court-ordered map, went from 13 Republicans and five Democrats to nine Republicans and nine Democrats. This didn’t quite match the popular vote, which broke for Democrats 55 percent to 45 percent, but the shift underscored that voting lines can matter as much as votes.

Nationwide, Democrats won the House popular vote by a larger margin than Republicans did in 2010, but Republicans that year gained significantly more seats, with 63.

MARGIN OF VICTORY Democrats won Republicans won +20 +15 +10 +5 +5 +10 +15 +20 Pennsylvania Election Results 2016 Pennsylvania Election Results 2018

Democrats say North Carolina is Exhibit A in how maps can defy the will of voters.

“These districts have been so gerrymandered in a partisan way that even in a year that was positive for Democrats, when you had really top-notch candidates running, who ran top-notch campaigns with a lot of funding, Democrats weren’t able to get through that hurdle,” said Morgan Jackson, a political adviser to Gov. Roy Cooper, a Democrat.

Republicans say the results reflect both voter preferences — North Carolina goes Republican in most federal races — and residential patterns. Democrats tend to be concentrated in urban areas, while Republicans are distributed more efficiently across suburban and rural terrain.

“That we have pretty close elections statewide is as relevant as how long an elephant can tap-dance on Mars,” said Dallas Woodhouse, executive director of the North Carolina Republican Party. “We draw district lines based on where people live, and the fact is an overwhelming amount of Democrats live in a handful of counties.”

While that pattern is well documented nationwide, registered Democrats actually outnumber registered Republicans in 57 of North Carolina’s 100 counties, according to data published by the North Carolina State Board of Elections. And Republicans have been quite candid about the role partisan politics plays in how North Carolinians are represented.

Republican Share of U.S. House Seats and Votes In North Carolina *Note: In the Ninth District, the Republican candidate leads but the race is uncalled.

The Republicans drew their first maps — for Congress and for the state legislature — after the 2010 census. Federal courts found that those maps were unconstitutionally gerrymandered based on race, to which legislators responded in 2016 by drawing a second set based largely on party.

State Representative David Lewis, a Republican redistricting committee leader, openly called the congressional map a “political gerrymander” when it was drafted, and said it would produce 10 Republicans and three Democrats because “I do not believe it’s possible to draw a map with 11 Republicans and two Democrats.”

Eighty-seven of North Carolina’s 100 counties are intact within a single district, as redistricting guidelines urge. Mr. Woodhouse said it was impossible to keep more than that intact and still follow the requirement that each district have an equal population. But the counties are grouped in ways that help Republicans.

“We’re in charge,” Mr. Woodhouse said. “That’s the way it works.”

Republicans also benefited from which 13 counties they chose to split. The results can be seen clearly in Guilford County, home of Greensboro, North Carolina’s third-largest city and a Democratic stronghold. The legislature split the city between the Sixth and 13th Districts, which had the effect of dissolving its voters into the red seas of North Carolinians outside the city limits and leaving the city represented entirely by Republicans in Congress.

North Carolina’s Congressional Map Splits Major Cities *Note: In the Ninth District, the Republican candidate leads but the race is uncalled.

Of the 57 counties where registered Democrats outnumber Republicans, only 17 have a Democratic representative in Congress. But every county where Republicans outnumber Democrats has a Republican representative.

Technology has only made this easier. In past decades, Mr. Li of the Brennan Center said, legislators might draft three or four maps and choose the one that benefited them most. Now, if they are so inclined, they can generate tens of thousands of possibilities, all precisely engineered based on hyperlocal voting data.

Gerrymandering is not the exclusive purview of Republicans. Where Democrats control state legislatures, they have done it too — for instance, in Maryland, where a court ordered a new congressional map this year. But because Republicans control a majority of state legislatures, they have had more opportunities to gerrymander and have done so to much greater effect in important swing states.

Interviews with voters in Greensboro indicated that few were aware of how the lines were drawn. But when shown the maps, many of them were disturbed.

Lee Jackson, 58, said he had voted Democratic in the past but did not vote this year. He lives in the 13th District — where the Democratic candidate, Kathy Manning, raised more money than the Republican incumbent, Ted Budd, but fell short in one of the state’s closest races.

Mr. Jackson said he felt the game was rigged.

“That’s one of the reasons I didn’t vote, because there’s so much trickery involved,” he said. “They say your vote matters, which it probably does, but then when they put little trickery like that into play, it’s like whoever is the most devious is bound to win.”

In North Carolina, the voting issues go well beyond gerrymandering.

In 2013, it passed one of the nation’s most restrictive voter identification laws, which a federal court struck down for targeting African-Americans “with almost surgical precision.” It tried to revoke thousands of voter registrations before the 2016 election, only to be blocked by a judge who called the process “insane.”

Legislators responded to a stream of adverse court rulings by drawing new judicial districts that benefited Republican judges and forced some African-American judges into contests with other incumbents. And Republican supermajorities voted to strip powers from the governor after Mr. Cooper was elected in 2016.

Some Democrats in North Carolina have been pushing for an independent redistricting commission. According to the Brennan Center, more than 70 percent of Democrats’ gains nationwide came in districts drawn by independent commissions or by courts, and only 19 percent came in districts drawn by Republican legislators.

But in the short term, Democrats are more concerned about the 2020 census. Darren Jackson, the Democratic leader in the North Carolina House, said the party badly needed to retake at least one chamber of the General Assembly in 2020 so it would “have a seat at the table” in the ensuing redistricting.

As a federal challenge to the current districts makes its way, most likely, to the Supreme Court, opponents of the maps are also taking a cue from Pennsylvania and pursuing a parallel challenge at the state level. If the Supreme Court will not reject partisan gerrymandering under the federal Constitution, they hope state courts will do so under the North Carolina Constitution.

In the meantime, there is another voting rights fight to be had — because Republicans responded to the judicial rejection of their voter identification law by putting it on the ballot as a constitutional amendment, which voters approved. The General Assembly is crafting the specifics of the requirement in a lame-duck session composed of veto-proof supermajorities that voters broke in this month’s elections.

Mr. Lewis said a final vote on the so-called implementing legislation would come late next week at the earliest because Republicans did not want the process to seem rushed.

Publicly, Democratic officials are withholding judgment until the legislature reveals which forms of identification will be accepted and how accessible IDs will be to people who don’t already have them. A major objection to the last voter ID law was that it did not accept student identification; as currently drafted, the new one would.

The Rev. William J. Barber II, the architect of the state’s Moral Mondays protest movement, said the fact that the requirement came via constitutional amendment this time would not stop Democrats or outside groups from suing again if they felt the legislation created discriminatory barriers.