A panel of federal judges on Tuesday declared North Carolina’s congressional map an “unconstitutional gerrymander,” giving lawmakers just two weeks to map new districts.

Judges appointed by former presidents Jimmy Carter, George W. Bush and Barack Obama unanimously condemned Republican legislators’ violation of the U.S. Constitution’s equal-protection clause.

“On its most fundamental level, partisan gerrymandering violates ‘the core principle of republican government… that the voters should choose their representatives, not the other way around,’” stated the majority opinion.

If a new map is not put in place by January 24, a special expert will be assigned to draw the districts.

But Republicans plan to fight the ruling, according to the Raleigh News & Observer. A spokesperson told the newspaper that legislative leaders will appeal to the U.S. Supreme Court. Although North Carolina’s electorate leans roughly 50-50 toward Republican and Democratic candidates, redistricting efforts have given Republicans a significant advantage by exploiting flaws in the electoral system.

State Rep. David Lewis, a lawmaker involved in the GOP’s gerrymandering effort, proposed in 2016 to “draw the maps to give a partisan advantage to 10 Republicans and three Democrats because I do not believe it’s possible to draw a map with 11 Republicans and two Democrats.”

Although the federal ruling is a win for Democrats, many Republicans have broken with their party over gerrymandering.

Last September, a group of past and present GOP lawmakers—including Arizona Senator John McCain, Ohio Governor John Kasich and former California Governor Arnold Schwarzenegger—filed briefs urging the Supreme Court to rule that extreme gerrymandering violates the Constitution.

The Supreme Court is expected to issue a definitive ruling on gerrymandering this June during the Gill v. Witford case—where Democratic citizens from Wisconsin are suing Republican legislators over redistricting efforts.