Justice Stephen G. Breyer wrote the opinion and said a lower-court panel should have looked at individual districts rather than statewide to decide whether there was racial gerrymandering. (Mandel Ngan/AFP/Getty Images)

The Supreme Court sided with black challengers Wednesday and told a lower court to reconsider whether a redistricting plan drawn by Alabama’s Republican-led legislature packed minority voters into districts in order to dilute their influence.

The court voted 5 to 4 to send the plan back for further judicial review. Justice Stephen G. Breyer wrote the opinion, and Justice Anthony M. Kennedy sided with the court’s liberals to make up the majority.

The challenge was brought by black officeholders and Democrats who argued that the state’s Republican leadership packed minority voters into districts that allowed the election of African American officials but reduced their influence elsewhere.

Breyer said a lower-court panel should have looked at individual districts rather than statewide in order to decide whether there was racial gerrymandering. And he said the legislators and the reviewing court did not use the proper test in deciding whether the redistricting was in line with the Voting Rights Act.

The act forbids “retrogression” in districts that favor minority candidates. But that does not mean the districts must retain a previous percentage of minority voters to meet the standard, Breyer wrote.

What is important instead is looking at what percentages are necessary to preserve the minority’s ability to elect the candidate of its choice, he said.

“Asking the wrong question may well have led to the wrong answer,” Breyer wrote.

The court’s jurisprudence on when race can be used in drawing legislative districts is complex and at times contradictory. And more than one justice pointed out during oral arguments that minority voters used to come to the court to demand that legislatures specifically use race to ensure that blacks and Hispanics be represented in government.

The court’s four most consistent conservatives — Chief Justice John G. Roberts Jr. and Justices Antonin Scalia, Clarence Thomas and Samuel A. Alito Jr. — said the decision could have implications far beyond the limited ruling the majority professed.

“The court issues a sweeping holding that will have profound implications for the constitutional ideal of one person, one vote, for the future of the Voting Rights Act of 1965, and for the primacy of the state in managing its own elections,” Scalia wrote in a dissent that all joined.

Thomas, the court’s only African American member, wrote separately to say that the intent of the Voting Rights Act has been “hijacked” by the Justice Department and the American Civil Liberties Union.

“We have somehow arrived at a place where the parties agree that Alabama’s legislative districts should be fine-tuned to achieve some ‘optimal’ result with respect to black voting power; the only disagreement is about what percentage of blacks should be placed in those optimized districts,” Thomas said. “This is nothing more than a fight over the ‘best’ racial quota.”

Alabama Attorney General Luther Strange (R) said that he was disappointed by the ruling but that it did not mean the maps needed to be redrawn nor new elections ordered. “My office will continue defending the state’s legislative districts,” he said in a statement.

While Breyer’s opinion did not say any districts were illegally drawn, he noted that “there is strong, perhaps overwhelming, evidence that race did predominate as a factor” in at least one.

At the time the districts were being drawn, Alabama was operating under Section 5 of the Voting Rights Act, and state officials said they believed they had to maintain previous percentages of minority voters in majority-minority districts. The number of blacks serving in the Alabama legislature is proportional to the state’s population.

But the Supreme Court effectively struck Section 5 in 2013, and Breyer acknowledged it is unclear what role it still plays. Even so, he said, Alabama legislators had interpreted it incorrectly.

Election law experts said the practical effect of the ruling is unclear.

Justin Levitt, a professor at Loyola Law School in Los Angeles who runs a blog about redistricting, said the lesson of the court’s ruling is that “it is incorrect for states to simply decide on a set percentage of minorities in a district, divorced from political facts on the ground.”

“The Voting Rights Act is concerned with real political opportunity for affected populations, and it’s a mistake to shift people based on their race into a district to hit a pegged percentage, without any reflection on whether that shift is necessary to maintain real political opportunity,” he said.

A federal court in Virginia has made a similar ruling about the state’s congressional districts, and there are other cases pending, Levitt said.

Richard Hasen, an election law expert at the University of California at Irvine Law School, said Alabama Republicans could probably redraw the lines to similar advantage with little trouble.

He said the court’s decision was a “small, albeit real, victory not only for minority voters but also for irony.”

“The ‘racial gerrymander’ cause of action, which was the basis for conservatives to challenge the creation of extra majority-minority districts under the Voting Rights Act, has now become a tool by those who hate the cause of action to protect minority voting rights,” Hasen wrote on his blog.

The case is Alabama Legislative Black Caucus v. Alabama.