A three-judge panel of federal judges ruled Monday that North Carolina legislators have until Sept. 1 to redraw state legislative districts to fix racial gerrymandering that unconstitutionally weakens the impact of African American voters.

Lawmakers sought to delay redrawing district lines until mid-November, but the court gave them a month. The court rejected plaintiffs’ request for special elections before the legislature’s May 2018 session.

U.S. District Court for the middle district of North Carolina ruled a year ago that 28 of the state’s 170 legislative districts were unconstitutional racial gerrymanders because lawmakers packed too many black voters into those districts when the state drew electoral boundaries in 2011. Republicans hold super-majorities in both houses of the North Carolina legislature.

The court later ordered the state to draw new districts and to hold special elections with those new lines by November. The Supreme Court upheld that ruling in June, but sent the case back to the lower court to decide whether special elections were necessary.

The three-judge panel on Monday said they would explain in a forthcoming opinion why they did not order special elections before regular voting in 2018. The judges said the Sept. 1 deadline finds a middle ground between Aug. 11, sought by the plaintiffs, and Nov. 15, advocated by the defendants.

“Although we appreciate that Legislative Defendants could have been gathering this information over the past months and weeks, Plaintiffs’ two-week schedule does not provide the General Assembly with adequate time to meet their commendable goal of obtaining and considering public input and engaging in robust debate and discussion,” the judges wrote. “Therefore, we prefer to give the legislature some additional time to engage in a process substantively identical to the one they have proposed.”

The judges chided Republicans for doing little to draw new districts, even after the Supreme Court decision in June.

“The General Assembly’s failure to comply with this Court’s August 2016 Order or to take any apparent action since the Supreme Court unanimously affirmed this Court’s judgment tends to indicate that the General Assembly does not appreciate the need to move promptly to cure the unconstitutional racial gerrymanders in the 2011 districting plans,” the judges wrote.

The court said it would be willing to extend the deadline until Sept. 15 if lawmakers disclose the criteria and maps they were considering, and have a clear process for receiving public comment.

Voting rights groups praised the decision.

“The court’s decision affirms the urgency with which we must address this wrong committed against North Carolina voters,” Allison Riggs, a senior attorney at the Southern Coalition for Social Justice, said in a statement. “This prompt redrawing will allow North Carolinians to, at least, rest assured knowing which districts they will be living in come the November 2018 elections, and that the federal court will be reviewing the remedial plans closely to ensure they are legal.”

Former Attorney General Eric Holder, who now heads a Democratic group focused on redistricting reform, said it was time for the state to “clean up its act.”

“This ruling is a significant step towards fairer maps that better represent North Carolinians,” Holder said in a statement. “Now, the legislature should move forward with a fair and timely effort to protect the rights of North Carolina voters. ... The rest of the nation will be watching.”

The Supreme Court also struck down two congressional districts in the state in May, saying state lawmakers had factored race too heavily when they drew the boundaries.