(Reuters) - Johnson & Johnson said on Tuesday it will pay $20.4 million to settle claims by two Ohio counties, allowing the U.S. healthcare giant to avoid an upcoming federal trial seeking to hold the industry responsible for the nation’s opioid epidemic.

J&J became the fourth drugmaker to settle claims ahead of the Federal Court trial against multiple manufacturers and distributors in Cleveland scheduled for later this month. The case is considered a bellwether for more than 2,600 lawsuits by state and local governments that are pending nationally.

“The settlement allows the company to avoid the resource demands and uncertainty of a trial as it continues to seek meaningful progress in addressing the nation’s opioid crisis,” J&J said in a statement.

“The company recognizes the opioid crisis is a complex public health challenge and is working collaboratively to help communities and people in need,” it added.

Opioids were involved in 400,000 overdose deaths in the United States from 1999 to 2017, according to the U.S. Centers for Disease Control and Prevention.

J&J which formerly marketed the painkillers Duragesic and Nucynta, said the settlement includes no admission of liability.

The company will pay $10 million to Cuyahoga and Summit counties, reimburse $5 million of their legal and other expenses and provide $5.4 million to non-profit organizations that run opioid-related programs in the counties.

Mallinckrodt Plc finalized a $24 million settlement with the same two counties on Monday. Endo International Plc and Allergan Plc also settled with the two counties in August to avoid going to trial.

The remaining defendants in the Oct. 21 federal trial include McKesson Corp, AmerisourceBergen, Cardinal Health, Teva Pharmaceutical Industries Ltd, Walgreens Boots Alliance Inc and Henry Schein Inc.

OxyContin maker Purdue Pharma LP succumbed to pressure from the lawsuits and filed for bankruptcy protection in September.

Some plaintiffs’ lawyers have compared the opioid cases to litigation by states against the tobacco industry that led to a $246 billion settlement in 1998.

Earlier in the year, an Oklahoma judge ordered Johnson & Johnson to pay $572.1 million to the state for its part in fueling an opioid epidemic by deceptively marketing addictive painkillers.

Purdue Pharma and Teva had settled claims by Oklahoma’s attorney general for $270 million and $85 million, respectively.