RALEIGH, N.C. — A replacement map for North Carolina’s congressional districts was finalized Friday, with its lines redrawn to address alleged extreme partisan bias and endangering reelection prospects for two Republicans next year.

The GOP-controlled General Assembly enacted boundaries for 2020 elections with a party-line vote in the state Senate.

The map, which had already cleared the state House on Thursday, was reconfigured because state judges last month blocked lines drawn in 2016 from being used next year.

The judges said evidence of partisan gerrymandering — Republicans carving up districts to maximize the number of winning districts favoring their party — made it likely that map violated the state constitution. So any remap was expected to narrow the 10-3 seat margin Republicans hold in the state’s U.S. House delegation.

Republicans offered maps that would place GOP Reps. Mark Walker of Greensboro and George Holding of Raleigh in districts that clearly favor Democratic candidates. Both of their current Republican-leaning districts — a mix of urban, suburban and rural areas — would be consolidated into more Democratic urban counties.

Neither Walker — the former chairman of the Republican Study Committee — nor Holding have said yet whether they’ll run anyway.

The prospect of two seats flipping parties next year would help national Democrats seeking to keep control of the U.S. House after the November 2020 elections. Some Democrats argue an 8-5 seat split favoring Republicans isn’t enough — saying partisan gerrymanders still exist in the new map that will keep races uncompetitive.

“There are circumstances under which it could be fair,” Senate Minority Leader Dan Blue of Raleigh, but “you need competition in these districts.” Unlike other legislation, redistricting maps aren’t subject to Democratic Gov. Roy Cooper’s veto stamp. But the Democratic and unaffiliated voters who sued over the map could challenge the replacement districts through current or new litigation.

A legal challenge of the replacement map threatens to derail the state’s congressional election schedule. Candidate filing is supposed to begin Dec. 2. The judges had topped short of ordering a new map because of the but suggested the legislature could act on its own quickly so that the planned March 3 primary could still occur.

Lawmakers agreed to redistricting criteria that were largely similar to what these same judges ordered in September, when they struck down dozens of legislative districts for extreme partisan bias. The legislators agreed to keep partisan data like voter registration and elections results and information about the racial makeup of voting blocs out of the mapmaking, which occurred in open committees streamed online.

“We have drawn this map in public. We have amended this map in public,” said Rep. David Lewis, who helped shepherd the new map through the House.

The 2016 congressional map was the subject of a federal lawsuit that went to the U.S. Supreme Court, where the majority ruled in June that federal courts should stay out of partisan gerrymandering controversies. But Chief Justice John Roberts wrote that state courts could intervene. A state lawsuit was filed shortly after state judges threw out legislative districts in early September.

North Carolina’s legislative or congressional districts have been the subject of litigation for most of this decade. Republicans took over both chambers of the General Assembly in 2010 for the first time in 140 years, allowing them to control the mapmaking and advance at will their right-leaning agenda until Democratic seat gains in 2018. Whichever parts wins the majority in the 2020 legislative elections will have the upper hand in drawing congressional and General Assembly maps based on next year’s census data.