Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The U.S. Supreme Court Monday threw out North Carolina's maps for two of the state's 13 congressional districts, a ruling that former attorney general Eric Holder called "a watershed moment in the fight to end racial gerrymandering."

In drawing the boundary lines for both districts, race was the predominant factor and the state failed to offer a compelling justification, the court said.

Justice Kagan with opinion in North Carolina redistricting case. Art Lien

North Carolina's maps, said Holder, "were among the worst racial gerrymanders in the nation."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Civil rights groups applauded the ruling.

"The Court made it clear that it would not allow states to get away with unlawful racial gerrymandering by claiming that it’s just politics. This is a critical decision as communities prepare for the 2020 redistricting," said Kristen Clarke, of the Lawyers’ Committee for Civil rights Under Law.

Related: "Why Is North Carolina's Legislature So Extreme? HB2 and the Cost of Gerrymandering"

The case involved challenges to District 1, bordering Virginia in the northeastern party of the state, and District 12, a long narrow slash through six counties in central North Carolina. They were redrawn after the 2010 census, increasing the minority population in each.

The state argued that it needed to increase the percentage of African American voters in District 1 to allow minorities a chance to elect the candidates of their choosing. But the Supreme Court found that implausible.

In five general elections under the old map, "all the candidates preferred by most African-American voters won their contests -- and by some handy margins," wrote Justice Elena Kagan. "North Carolina too far downplays the significance of a longtime pattern of white crossover voting."

The court's ruling was unanimous that District 1 was improperly drawn with race as the predominant factor, but the court split 5-3 on whether District 12 was, too.

The state argued that it redrew the District 12 boundaries to bring in more Democrats, which had the incidental effect of increasing the minority population.

But the court said the redesign brought in 35,000 more African-Americans of voting age and reduced the number of white voters by 50,000. Ample evidence was offered to support the conclusion that "race, not politics, accounted for the district's reconfiguration," Kagan said.

"This will lead to many more successful racial gerrymandering cases in the American South," said Prof. Rick Hasen, an election law expert at the University of California at Irvine. "It means the sorting of voters on the grounds of their race remains suspect even if race is meant to function as a proxy for political characteristics."