In a statement on Monday, Johnson & Johnson described the judge’s decision as flawed and said Oklahoma had failed to present evidence that the company’s actions constituted a public nuisance, which was a central question of the trial. Purdue and Teva, had previously settled with Oklahoma and agreed to pay the state $270 million and $85 million, respectively .

Johnson & Johnson also defended its business as an opiate supplier, saying it had followed state and federal regulations and that the subsidiaries, which it sold in 201 6, played no role in the marketing or sale of finished products. Beyond its poppy business, Johnson & Johnson drugs accounted for less than 1 percent of opioids prescribed in Oklahoma and the United States, the company said.

Although the Oklahoma judge ruled that Johnson & Johnson’s behavior violated the state’s public nuisance law, similar attempts to hold companies accountable for their harmful products have fallen short in other cases. Elizabeth Burch, a law professor at the University of Georgia, said that lawsuits using public nuisance laws had failed against gun manufacturers.

“You can draw an analogy there, mainly because once you sell a gun, it is no longer in the control of the gun manufacturers,” she said.

Andrew S. Pollis, a law professor at Case Western Reserve University, said pharmaceutical manufacturers may not be off the hook.

“You can have liability for manufacturing something that you know is being used to an illegal or a harmful end, or if you know the volume of your sales is upside down relative to the population,” he said. In Oklahoma, more than 326 million opioid pills were dispensed to state residents in 2015, enough for every adult in the state to receive 110 pills, according to the judge’s decision .

Some public health experts said companies should be held accountable when they supply ingredients that they should have known were causing harm.