The Supreme Court has thrown out a North Carolina court ruling that upheld Republican-drawn electoral districts for state and congressional lawmakers.

The justices on Monday ordered the state Supreme Court to consider anew whether the North Carolina legislature relied too heavily on race when it redrew voting districts following the 2010 census.

The high court issued a similar ruling last month involving a complaint from black Alabama Democrats that the Republican-dominated legislature illegally packed black voters into too few voting districts.

In Alabama, the justices said a lower court used the wrong test when it upheld legislative districts and determined that race was not the primary motivating factor in drawing boundary lines.

The Supreme Court said judges in North Carolina must revisit their ruling in light of the Alabama decision.