(Reuters) - A U.S. court panel has ruled there is not enough time to recast North Carolina’s congressional maps ahead of the November elections even though it found the Republican-constructed lines were illegally drawn for partisan purposes.

FILE PHOTO: Visitors wait to enter the U.S. Supreme Court, as the Court sent back to a lower court a decision that Republicans in North Carolina had drawn congressional district boundaries to give their party an unfair advantage, in Washington, U.S., June 25, 2018. REUTERS/Toya Sarno Jordan/File Photo

The legal battle has unfolded as Democrats nationally are trying to wrest control of the U.S. House of Representatives, needing to pick up 23 seats to gain a majority that could thwart Republican President Donald Trump’s legislative agenda.

“Imposing a new schedule for North Carolina’s congressional elections would, at this late juncture, unduly interfere with the State’s electoral machinery and likely confuse voters and depress turnout,” the three-judge panel at a federal district court in North Carolina said in a decision issued late on Tuesday.

The ruling came less than a week after groups who successfully sued North Carolina over the maps said statewide redistricting just weeks before Election Day on Nov. 6 would not be a good-government solution.

The same judges ruled on Aug. 27 that North Carolina Republicans illegally drew up U.S. congressional districts in the state to benefit their party. It gave those involved in the lawsuit until the end of August to recommend fixes, but neither side offered a new map.

“North Carolina will have to suffer again under yet another unconstitutional Republican law that silences voters, divides our state, and undermines our democracy,” Wayne Goodwin, the state’s Democratic Party chairman, said in a statement. The party was a plaintiff in the suit.

Republicans in 2016 won 10 of the 13 House districts - 77 percent - despite getting just 53 percent of the statewide vote, nearly the same result as in 2014.

“This ruling has removed the last remaining obstacle to printing ballots, and it’s time for the State Board of Elections to do their job and print them as soon as possible,” said North Carolina Republican Senate Leader Phil Berger.

The North Carolina dispute centered on a congressional redistricting plan adopted by the Republican-led legislature in 2016 after a court found that Republican lawmakers improperly used race as a factor when redrawing certain U.S. House districts after the 2010 census.

The Republican lawmaker in charge of the plan said it was crafted to maintain Republican dominance because “electing Republicans is better than electing Democrats.”