(Bloomberg) -- Endo International Plc agreed to an $11 million settlement to avoid trial in the first federal court cases targeting opioid makers and distributors over the public-health crisis caused by the painkillers. The shares surged on the news.Endo said Tuesday it will pay $10 million and donate $1 million worth of diabetes and allergy drugs to resolve claims by two Ohio municipalities it helped fuel the U.S. opioid epidemic by illegally marketing its Opana painkiller. The deal only resolves two cases set for trial in October and leaves intact lawsuits against Endo filed by more than 2,000 local governments over its handling of Opana. The October trial will still proceed against other drugmakers.The settlements come as a judge in Oklahoma is set to rule next week on whether Johnson & Johnson must pay more than $17 billion to reimburse the state for tax dollars spent fighting the opioid epidemic. The case is the first to seek to hold a drugmaker liable for the fallout from opioid addiction and overdoses.Endo officials said the Ohio settlement didn’t reflect what it expects to pay to resolve the other opioid suits.

“The cash portion of the settlement approximates the estimated cost to Endo of proceeding through trial,” Matthew Maletta, Endo’s executive vice president and chief legal officer, said in an emailed statement.

News of the settlement rallied Endo shares, sending them higher by as much as 33% in New York trading Tuesday. Other companies named in other opioid suits, including Allergan Plc, Teva Pharmaceutical Industries Ltd. and Mallinckrodt Plc also gained.

Representatives for Allergan, Teva and Mallinckrodt didn’t immediately respond to requests for comment.The local governments’ cases are consolidated before U.S. District Judge Dan Polster in Cleveland, who has pushed opioid makers such as Endo and J&J, and distributors such as McKesson Corp. and Cardinal Health Inc., to settle.The case is In Re: National Prescription Opiate Litigation, 17-md-2804, U.S. District Court, Northern District of Ohio (Cleveland).

To contact the reporters on this story: Jef Feeley in Wilmington, Delaware at jfeeley@bloomberg.net;Riley Griffin in New York at rgriffin42@bloomberg.net

To contact the editors responsible for this story: Heather Smith at hsmith26@bloomberg.net, Timothy Annett

©2019 Bloomberg L.P.