Justice Stephen G. Breyer wrote both majority opinions, concluding in each that the lower court had used the wrong legal standard and must reconsider the case under the correct one.

In the voting rights case, the court indicated that the Alabama State Legislature had relied too heavily on race in its 2012 state redistricting by maintaining high concentrations of black voters in some districts.

The vote was 5 to 4, with Justice Anthony M. Kennedy joining the court’s four more liberal members to form a majority.

The 2012 maps were challenged by the Alabama Legislative Black Caucus, the Alabama Democratic Conference and other plaintiffs. They said Republican state legislators had engaged in “racial gerrymandering” by paying too much attention to making districts almost identical in population and by making sure that substantial black majorities in existing districts were not even slightly diminished.

Justice Breyer, writing for the majority, said a lower court had erred in considering the case on a statewide basis rather than district by district.

“A racial gerrymandering claim must have to do with the boundaries of individual districts,” Justice Breyer said in summarizing his opinion from the bench. “Indeed, a purely statewide claim is a legal unicorn.”

Justice Breyer added that the lower court had placed too much emphasis on making sure that districts had equal populations and had been “too mechanical” in maintaining existing percentages of black voters.

“Imagine a majority-minority district with a 70 percent black population,” he wrote. “Assume also that voting in that district, like that in the state itself, is racially polarized. And assume that the district has long elected to office black voters’ preferred candidate.”

In those circumstances, he said, it is hard to imagine why increasing the overall population of a district while reducing the percentage of blacks to 65 percent would make it harder for black voters to elect their preferred candidates.

Richard L. Hasen, an expert on election law at the University of California, Irvine, said Wednesday’s decision might represent only a short-term victory for the plaintiffs.

“It seems likely on remand that at least some of Alabama’s districts will be found to be racial gerrymanders,” he wrote in a blog post. “This means that some of these districts will have to be redrawn to ‘unpack’ some minority voters from these districts.”

“But do not be surprised,” he continued, “if Alabama pre-empts the lawsuit by drawing new districts which are less racially conscious but still constitute a partisan gerrymander which helps the Republicans have greater control over the Alabama legislative districts.”

Image

Also on Wednesday, the Supreme Court revived a discrimination lawsuit brought against UPS by Peggy Young, right.CreditStephen Crowley/The New York Times

In dissent, Justice Antonin Scalia said the decision was “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.”

Chief Justice John G. Roberts Jr. and Justices Clarence Thomas and Samuel A. Alito Jr. joined the dissent, which focused in large part on what Justice Scalia said were procedural irregularities in the litigation.

Justice Thomas issued a separate dissent taking issue with what he called “the court’s misguided and damaging jurisprudence” in the area of voting rights.

“I do not pretend that Alabama is blameless when it comes to its sordid history of racial politics,” he wrote. “But today, the state is not the one that is culpable.”

“Its redistricting effort was indeed tainted, but it was tainted by our voting rights jurisprudence and the uses to which the Voting Rights Act has been put,” he continued. He said the Justice Department and groups like the American Civil Liberties Union had long ago “hijacked the act, and they have been using it ever since to achieve their vision of maximized black electoral strength, often at the expense of the voters they purport to help.”

The pregnancy discrimination case concerned Peggy Young, a UPS worker whose doctor recommended that she avoid lifting anything heavy after she became pregnant. The company refused to give her lighter duties to accommodate her and placed her on unpaid leave in 2006.

Ms. Young sued under the federal Pregnancy Discrimination Act, which requires employers to treat “women affected by pregnancy” the same as “other persons not so affected but similar in their ability or inability to work.”

Her lawsuit was dismissed, with a unanimous three-judge panel of the United States Court of Appeals for the Fourth Circuit in Richmond, Va., saying the pregnancy law does not give pregnant women “a ‘most favored nation’ status.”

The Supreme Court, by a 6-to-3 vote, vacated that decision and said Ms. Young deserved another shot at trying to prove that the company had violated the law.

The pregnancy discrimination law, Justice Breyer wrote, “requires courts to consider the extent to which an employer’s policy treats pregnant workers less favorably than it treats nonpregnant workers similar in their ability or inability to work.”

He noted that company had made accommodations for workers who were injured on the job, who were covered by the Americans With Disabilities Act and who lost their driving certification from the Department of Transportation. The question for the lower court, Justice Breyer said, was whether “the employer accommodates a large percentage of nonpregnant workers while failing to accommodate a large percentage of pregnant workers.”

Justice Alito voted with the majority but did not adopt its rationale. His concurrence questioned whether the company had “any neutral business ground” for treating pregnant drivers differently from those who had lost their driving certifications.

UPS has since changed its policy, offering light duty to pregnant women.

Justice Scalia, joined by Justices Kennedy and Thomas, dissented in the case, Young v. United Parcel Service, No. 12-1226.

Justice Scalia said the words of the law could not bear the interpretation the majority had imposed on it. “The court seems to think our task is to craft a policy-driven compromise between the possible readings of the law,” he wrote, “like a congressional conference committee reconciling House and Senate versions of a bill.”

A version of this article appears in print on , on Page A12 of the New York edition with the headline: Justices Side With Black Lawmakers in Alabama. Order Reprints | Today’s Paper | Subscribe