RALEIGH, N.C. (AP) — Federal judges on Thursday struck down nearly 30 North Carolina House and Senate districts as illegal racial gerrymanders, but will allow General Assembly elections to be held using them this fall.

The decision by a three-judge panel comes six months after another set of judges struck down North Carolina’s congressional districts for similar reasons. Thursday’s ruling covering 19 House and nine Senate districts is yet another blow to the GOP lawmakers in North Carolina, which has seen several laws it enacted either partially or wholly overturned by federal or state courts.

The U.S. Supreme Court announced in June that it would hear the appeals of Republican state leaders in the congressional case, where two majority-black districts were thrown out. The previous map drawn in 2011 and still being challenged helped give the state GOP more seats within the congressional delegation in the swing state.

The legislative maps, also approved in 2011, aided Republicans in padding their majorities in the two chambers after they took control of the legislature for the first time in 140 years the year before.

Writing for the panel in Thursday’s ruling, U.S. Circuit Judge James Wynn said there’s not enough time for lawmakers to draw new General Assembly districts and conduct elections under them in November. The plaintiffs had asked that the districts they challenged be blocked from use in any future elections.

Instead, state lawmakers will be required to fashion new plans when they reconvene for their legislative session early next year. With so many districts struck down, new maps could affect most of the 170 legislative districts.

Postponing the 2016 legislative elections “would cause significant and undue disruption to North Carolina’s election process and create considerable confusion, inconvenience, and uncertainty among voters, candidates, and election officials,” Wynn wrote.

“Nonetheless, plaintiffs, and thousands of other North Carolina citizens, have suffered severe constitutional harms” from the illegal boundaries, Wynn added, raising the possibility of special elections before the next ones scheduled for November 2018.

Legislative leaders who helped draw the maps said the ruling contradicts a decision by the U.S. Justice Department in 2011 not to challenge the maps and rulings by the state Supreme Court upholding the maps.

“However, we are relieved for voters that the … court did not disrupt the current election that is already underway,” Rep. David Lewis, R-Harnett, and Sen. Bob Rucho, R-Mecklenburg, said in a statement, adding they were evaluating their next legal steps. Appeals would go to the U.S. Supreme Court.

All but one of the challenged districts had black voting-age populations above 50 percent.

Attorneys for the state said racial polarization in voting still exists in North Carolina and that a 2009 U.S. Supreme Court decision says legislators can find safe harbor from U.S. Voting Rights Act liability when they draw majority-black districts in areas that can support them.

During a trial in Greensboro in April, current and former Democratic legislators and redistricting experts testified there had been no need for GOP legislative leaders to draw so many House and Senate districts with majority-black populations. The judges cited several districts for their bizarre shapes.

The plaintiffs said black and white voters had been joining forces in recent years to elect candidates in districts with black populations below 50 percent. Instead, black voters were cordoned off into certain districts, creating three times as many majority-black districts compared to the 2000s, when Democrats largely controlled the mapping process.

Thursday’s “decision is a clear message that North Carolina voters have a right not to be assigned to election districts based solely on the color of their skin,” Sandra Covington of Fayetteville, the lead plaintiff in the case, said in a release.

Wynn wrote state leaders didn’t take into account within their polarization studies the levels of “crossover” voting by whites that helped the favored candidates of black voters win.

“Our decision today should in no way be read to imply that majority-black districts are no longer needed in the state of North Carolina,” Wynn wrote. Rather, he said, the General Assembly carried out a “mechanical approach to districting” and was unable to defend the predominant use of race in drawing the maps.

The legislature redrew the congressional maps following a February court decision and delayed congressional primaries until June.