(Reuters) - A North Carolina court on Tuesday struck down the Republican-drawn state legislative map as an illegal partisan gerrymander and gave lawmakers two weeks to enact new district lines for next year’s elections.

Slideshow ( 2 images )

A three-judge panel in Wake County Superior Court said the state Senate and state House district lines discriminated against Democratic voters in violation of the state constitution’s free elections, equal protection and free speech clauses.

The decision is a victory for election reform advocates considering legal challenges to partisan gerrymandering in state courts despite a U.S. Supreme Court ruling earlier this year blocking such cases in federal courts.

In an opinion running more than 350 pages, the judges said Republican state legislators had employed “surgical precision” to dilute Democratic voters’ strength, ensuring their party would control both chambers of the legislature “in all but the most unusual election scenarios.”

“The 2017 enacted maps, as drawn, do not permit voters to freely choose their representative, but rather representatives are choosing voters based upon sophisticated partisan sorting,” the court wrote after hearing evidence during a trial in July.

State Senate Leader Phil Berger, a Republican, criticized the case as an attempt to “game” the redistricting process but signaled lawmakers would not appeal the decision to the state Supreme Court.

“To end this matter once and for all, we will follow the court’s instruction and move forward with adoption of a nonpartisan map,” Berger said in a statement.

The closely watched case was the first to reach trial since the U.S. Supreme Court ruled in June that federal courts have no authority to curb partisan gerrymandering - the practice of drawing electoral maps to entrench one party in power.

The Supreme Court decision did not explicitly bar state courts from evaluating gerrymandering cases based on state constitutions, which sometimes have language that goes further than the federal version. North Carolina’s constitution, for instance, has a free elections clause, which has no counterpart in the U.S. constitution.

Government reformers have already voiced their intent to file more cases in state courts.

Last year, the Pennsylvania Supreme Court issued a similar ruling, tossing the state’s U.S. congressional map and commissioning an independent expert to redraw the lines. The new map was credited with helping Democrats split the state’s 18 congressional seats in 2018 after years of Republican dominance.

Tuesday’s ruling concerned only the state legislative districts, but legal experts have said it could open the door to a similar lawsuit challenging North Carolina’s congressional map, which is also widely seen as gerrymandered.

“This is a historic victory for the people of North Carolina,” said Bob Phillips, the executive director of Common Cause North Carolina, the government reform group that brought the lawsuit.

Meanwhile, the new state legislative map will likely improve Democrats’ chances of breaking the Republican majority in the state capitol.

The party that controls the state legislature following next year’s election will be in charge of drawing new congressional and state legislative maps after the U.S. Census is complete.

“We look forward to taking back control of the General Assembly using fair maps next November,” the state Democratic chairman, Wayne Goodwin, said.