WASHINGTON >> The Supreme Court on Thursday issued a surprising 5-4 ruling in favor of Black voters in a congressional redistricting case from Alabama, with two conservative justices joining liberals in rejecting a Republican-led effort to weaken a landmark voting rights law.

Chief Justice John Roberts and Justice Brett Kavanaugh aligned 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 districts in a state where more than one in four residents is Black. The state now will have to draw a new map for next year’s elections.

The decision was keenly anticipated for its potential effect on control of the closely divided U.S. House of Representatives. Because of the ruling, new maps are likely in Alabama and Louisiana that could allow Democratic-leaning Black voters to elect their preferred candidates in two more congressional districts.

The outcome was unexpected in that the court had allowed the challenged Alabama map to be used for the 2022 elections, and in arguments last October the justices appeared willing to make it harder to challenge redistricting plans as racially discriminatory under the Voting Rights Act of 1965.

The chief justice himself suggested last year that he was open to changes in the way courts weigh discrimination claims under the part of the law known as section 2. But on Thursday, Roberts wrote that the court was declining “to recast our section 2 case law as Alabama requests.”

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

The other four conservative justices dissented Thursday. Justice Clarence Thomas wrote that the decision forces “Alabama to intentionally redraw its longstanding congressional districts so that black voters can control a number of seats roughly proportional to the black share of the State’s population. Section 2 demands no such thing, and, if it did, the Constitution would not permit it.”

The Biden administration sided with the Black voters in Alabama.

Attorney General Merrick Garland applauded the ruling: “Today’s decision rejects efforts to further erode fundamental voting rights protections, and preserves the principle that in the United States, all eligible voters must be able to exercise their constitutional right to vote free from discrimination based on their race.”

Evan Milligan, a Black voter and the lead plaintiff in the case, said the ruling was a victory for democracy and people of color.

“We are grateful that the Supreme Court upheld what we knew to be true: that everyone deserves to have their vote matter and their voice heard. Today is a win for democracy and freedom not just in Alabama but across the United States,” Milligan said.

Alabama Republican Party Chairman John Wahl said in a statement that state lawmakers would comply with the ruling. “Regardless of our disagreement with the Court’s decision, we are confident the Alabama Legislature will redraw district lines that ensure the people of Alabama are represented by members who share their beliefs, while following the requirements of applicable law,” Wahl said.

But Steve Marshall, the state’s Republican attorney general, said he expects to continue defending the challenged map in federal court, including at a full trial. “Although the majority’s decision is disappointing, this case is not over,” Marshall said in a statement.

Deuel Ross, a civil rights lawyer who argued the case at the Supreme Court, said the justices have validated the lower court’s view in this case. A full trial “doesn’t seem a good use of Alabama’s time, resources or the money of the people to continue to litigate their case.”