A panel of federal judges ruled this afternoon that lawmakers must use a redistricting plan created by a special master in upcoming legislative elections.

The plan comes after a court ruled last year that twenty-eight of the state’s legislative districts were illegal racial gerrymanders. In response, a legislative redistricting committee this summer came up with a new plan that was intended to fix the gerrymandered districts.

However, challengers argued that some of the new districts were still racially gerrymandered. In response, the court ordered an outside party (known as a special master), Nathaniel Persily of Stanford University, to come up with redistricting plans for nine new districts that the plaintiffs had challenged. Persily submitted those plans last month, and this afternoon, the court approved his plan and ordered lawmakers to use it in upcoming elections.

Democrats and voting rights advocates cheered the decision.

“Today’s order is a key victory for North Carolina voters and a major step towards fair representation,” said Wayne Goodwin, chairman of the North Carolina Democratic Party. “Republicans unconstitutionally rigged our elections for years, silencing North Carolina voters, in particular communities of color. We applaud the court’s decision and look forward to competing in fairer districts across the state.”

“We applaud the court’s ruling to order a new, constitutional legislative redistricting plan be put into effect immediately for North Carolina’s 2018 elections,” said Tomas Lopez, the executive director of Democracy North Carolina, a voting rights organization. “For too long, North Carolinians have had their voices quieted by maps that packed and cracked their political power. We hope today’s ruling will lead legislative leaders to finally allow voters an opportunity to pick their lawmakers, not the other way around.”

The news comes a day after the Supreme Court blocked a lower court’s order for the state to redraw Congressional maps that were ruled to be unconstitutional partisan gerrymanders.