WASHINGTON — The Supreme Court on Thursday issued a surprising ruling in favor of Black voters in a congressional redistricting case, ordering the creation of a second district with a large Black population.

Chief Justice John Roberts and Justice Brett Kavanaugh joined with the court's liberals in affirming a lower-court ruling that found a likely violation of the Voting Rights Act in an Alabama congressional map with one majority Black seat out of seven congressional districts in a state where more than one in four residents is Black.

The case had been closely watched for its potential to weaken the landmark voting rights law.

The court had allowed the challenged map to be used for the 2022 elections and at arguments in October, the justices appeared willing to make it harder to use the voting rights law to challenge redistricting plans as racially discriminatory.

Supreme Court Redistricting Alabama

FILE - Alabama Solicitor General Edmund LaCour, right, speaks alongside Alabama Attorney General Steve Marshall following oral arguments in Merrill v. Milligan, an Alabama redistricting case, outside the Supreme Court on Capitol Hill in Washington, Oct. 4, 2022. The Supreme Court on Thursday, June 8, 2023, issued a surprising ruling in favor of Black voters in a congressional redistricting case, ordering the creation of a second district with a large Black population. (AP Photo/Patrick Semansky, File)

Roberts was part of conservative high-court majorities in earlier cases that made it harder for racial minorities to use the Voting Rights Act of 1965 in ideologically divided rulings in 2013 and 2021.

The other four conservative justices dissented Thursday.