WASHINGTON (AP) -- The Supreme Court struck down two congressional districts in North Carolina Monday because race played too large a role in their creation, a decision voting rights advocates said would boost challenges in other states.

The justices ruled that Republicans who controlled the state legislature and governor's office in 2011 placed too many African-Americans in the two districts. The result was to weaken African-American voting strength elsewhere in North Carolina.

In recent years, the Supreme Court has ruled for civil rights groups and black voters in challenges to political districts in Alabama, North Carolina and Virginia.

A Democratic group led by former Attorney General Eric Holder is focusing on redistricting challenges to counter political gains Republicans have made since the 2010 census and the redrawing of electoral districts that followed.

In North Carolina, both districts have since been redrawn and the state conducted elections under the new congressional map in 2016. Even with the new districts, Republicans maintained their 10-3 edge in congressional seats.

A separate challenge has been filed to the redrawn districts, this time claiming that politics played too much of a role in their creation. The Supreme Court has never ruled that a partisan gerrymander violates the Constitution.

Justice Elena Kagan, writing for the court, said the state did not offer compelling justifications to justify its reliance on race in either district.

The issue of race and redistricting one is a familiar one at the Supreme Court and Kagan noted that one of the districts was "making its fifth(!) appearance before this court."

States have to take race into account when drawing maps for legislative, congressional and a host of municipal political districts. At the same time, race can't be the predominant factor without very strong reasons, under a line of high court cases stretching back 20 years.

A three-judge federal court had previously struck down the two districts. The justices upheld the lower court ruling on both counts.

The court unanimously affirmed the lower court ruling on District 1 in northeastern North Carolina. Kagan wrote that the court will not "approve a racial gerrymander whose necessity is supported by no evidence."

The justices split 5-3 on the other district, District 12 in the southwestern part of the state. Justice Clarence Thomas joined the four liberal justices to form a majority. Chief Justice John Roberts and Justices Samuel Alito and Anthony Kennedy dissented. Justice Neil Gorsuch did not part in the case.

The state insisted that race played no role at all in the creation of one district. Instead, the state argued that Republicans who controlled the redistricting process wanted to leave the district in Democratic hands, so that the surrounding districts would be safer for Republicans.

"The evidence offered at trial...adequately supports the conclusion that race, not politics, accounted for the district's reconfiguration," Kagan wrote.

Alito said in dissent that the evidence instead shows that the district's borders "are readily explained by political considerations."

Voting rights advocates said the ruling supports their arguments in yet another case pending before the Supreme Court that challenges North Carolina's state legislative districts. A federal court had previously thrown out 28 state House and Senate districts as illegal racial gerrymanders.

But earlier this year the Supreme Court temporarily halted an order to redraw those legislative districts. The justices could act on the challenge to the state districts as early as next week.

The lawyer leading the challenge to the state districts, Anita Earls of the Southern Coalition for Social Justice, said Monday's ruling has clear implications for that case.

"It's abundantly clear that what the state of North Carolina did in drawing its legislative districts cannot withstand constitutional muster," she said in a phone interview.

The court action comes at a time of intense political division in the state, highlighted by legal battles over moves by the GOP-controlled legislature to pass laws limiting some of the powers of North Carolina's new Democratic governor, Roy Cooper. Democrats have hoped that a redrawing of state districts could help them erode veto-proof majorities in both chambers of the General Assembly.

Cooper issued a statement applauding Supreme Court for supporting "a level playing field and fair elections" for voters.

"The North Carolina Republican legislature tried to rig Congressional elections by drawing unconstitutional districts that discriminated against African Americans and that's wrong," Cooper said.

The Rev. William Barber, the president of the North Carolina NAACP who has sued separately over voting rights, said the high court's ruling shows that the General Assembly "engaged in systemic racism and cheated to win elections."

Holder said the National Democratic Redistricting Committee that he leads "will aggressively pursue new cases to end similar illegal racial gerrymandering in other states."