“But sympathy for respondent does not relieve us of the responsibility of following the law,” Justice Alito wrote.

The ruling is similar to a decision by the court in 2011, in Pliva v. Mensing, which found that generic drug makers could not be held liable for failing to warn about a drug’s dangers because they must use the same safety label as the brand-name version. Monday’s decision further limits the legal avenues for people who take generic drugs, which now account for more than 80 percent of all prescriptions.

“Now, presumably, a patient harmed by those drugs has no remedy, either through a defective warning or a defective design argument,” said Bill Curtis, a Houston lawyer who specializes in pharmaceutical cases.

Generic drug manufacturers hailed the decision, arguing that the decisions of state courts should not supplant the authority of the Food and Drug Administration, which approves the brand-name drugs and the generic copies.

“It makes much more sense to rely on the judgments of the scientific and medical experts at the F.D.A, who look at drug issues for the nation at large, than those of a single state court jury that only has in front of it the terribly unfortunate circumstances of an adverse drug reaction,” said Jay P. Lefkowitz, who represented Mutual before the Supreme Court and also argued on behalf of generic companies in the Pliva v. Mensing case.