RALEIGH, N.C. (AP) — A North Carolina redistricting ruling has set up a possible electoral windfall for congressional Republicans in preserving their U.S. House majority next year, declaring that judges should stay out of scrutinizing seat boundaries for partisan advantage.

While Democrats only need to flip five GOP seats overall to regain control, experts say the state Supreme Court decision means four Democratic incumbents in the state — three of them first-term members — are vulnerable.

Meanwhile, litigation involving congressional maps in states such as Alabama, Louisiana, Georgia, Ohio and Texas could also rework district lines and alter the 2024 electoral map.

The legal guardrails on redistricting are in an unusual state of flux. State and federal courts both were active in striking down congressional maps during the most recent bonanza of redrawing legislative lines based on once-a-decade census data. Additional action by the U.S. Supreme Court in the coming weeks could spark new challenges and redrawn maps.

North Carolina’s highest court, chosen through partisan elections, flipped to Republican in November. That new Republican majority in late April threw out a 2022 Democratic ruling against partisan gerrymandering, saying the state constitution did not limit the practice.

The state’s map, created after last year’s court decision, was used last fall, when voters elected seven Democrats and seven Republicans. North Carolina’s statewide races are routinely close, with voter registrations roughly in thirds among Democrats, Republicans and unaffiliated residents. Just four years earlier, Republicans had won comfortably 10 of the 13 House seats in the country’s ninth-largest state.

Freed from the Democratic constraints, the General Assembly — also controlled by Republicans — plans to redraw those districts by before the 2024 elections.

“It’s a signal to the Republican supermajority that within some boundaries they can draw the maps they want,” said Chris Cooper, a Western Carolina University political science professor. “The Republicans don’t have a blank check, but there’s a lot in the bank account.”

While North Carolina Republicans don’t have details yet on what the new maps will look like, House Speaker Tim Moore said after last year’s elections that “7-7 does not reflect the will of the voters in North Carolina.” A map approved by Republicans in 2021, but never implemented because it was struck down, would have given the GOP a strong chance to win 10 seats. North Carolina gained a 14th seat this decade thanks to population growth.

The North Carolina ruling “could have an enormous impact on the control of the House,” said Dave Wasserman, an editor at the nonpartisan Cook Political Report. A map that tears up the districts of at least four Democrats “would effectively double the Republican cushion” ahead of next year, he said.

State Democrats have few options. The state constitution exempts redistricting legislation from Democratic Gov. Roy Cooper’s veto.

“I hold out hope that they … won’t be as extreme as the courts seem to have given them leeway to be,” Democratic state Sen. Natasha Marcus said. “But I’m also a realist.”

Except for federal laws preventing racial gerrymandering and other redistricting standards — such as making districts identical by population — the legislature will have free rein.

“If you want to maximize your power you’re going to draw whatever districts the Voting Rights Act requires and you’re going to engage in the most partisan gerrymandering that you can,” said Rick Hasen, a law professor at the University of California, Los Angeles, who follows redistricting and election litigation.

Based on interviews and previous maps, one of the most vulnerable Democrats is expected to be first-term Rep. Jeff Jackson of Charlotte. Even though he won the new 14th Congressional District by 15 percentage points, there are many ways to make the district more Republican.

“They’re coming for this seat,” said Jackson, a former state senator who has gained prominence using TikTok to reach voters, in a fundraising email.

Also at risk is first-term Rep. Wiley Nickel, who represents the Raleigh-area 13th District. He won the state’s lone 2022 toss-up race by 3 percentage points.

Nickel told The Associated Press the Supreme Court’s decision was “pure partisan politics” and called the 2022 boundaries “an absolutely fair map for a 50-50 state.”

Other endangered Democrats are 6th District Rep. Kathy Manning, who represents the Greensboro area, and first-term Rep. Don Davis, who represents almost 20 northeastern North Carolina counties in the 1st District.

During the previous decade, North Carolina Republicans enjoyed a significant advantage in the way congressional districts were drawn, even as courts repeatedly ordered new maps because of gerrymandering. In both 2016 and 2018, Republicans won between two and three more seats than would have been expected based on their share of the votes, according to an AP analysis using a mathematical formula designed to detect gerrymandering.

In 2020, when Republicans won an 8-5 congressional advantage, the GOP still carried one more seat than expected based on their votes.

But that changed with the 2022 election. Republicans received 52% of the vote, but Democrats outperformed them – carrying 0.6 of a seat more than expected based on their share of the votes, according to the AP’s analysis.

Nationally, Democrats are pushing back against the idea that North Carolina losses are inevitable. Their candidates have already shown they can win in tight districts, said Tommy Garcia, a Democratic Congressional Campaign Committee spokesperson.

Meanwhile, the National Republican Congressional Committee looks “forward to the state Legislature drawing fair lines that best represent North Carolina,” communications director Jack Pandol said.

The U.S. Supreme Court is due to issue a ruling soon that could change rules requiring mapmakers to draw districts that allow minorities to elect representatives of their choosing.

Also before the high court is a case brought by North Carolina Republicans who argued the state’s courts didn’t have the power to implement the map that produced the 7-7 congressional split last year. However, the justices’ decision won’t affect the upcoming map draw in North Carolina.