Johnson & Johnson on Tuesday announced it had reached an agreement worth more than $20 million with two Ohio counties, becoming the latest company to settle a lawsuit to get out of the first federal trial over the nation’s opioids crisis.

The deal with Cuyahoga and Summit counties comes a little more than a month after an Oklahoma judge ordered the New Brunswick, New Jersey-based health care conglomerate to pay $572 million over its marketing of opioids in that state.

It was announced less than three weeks before the scheduled start of the first federal trial over the opioid crisis. Four other opioid makers also have reached settlements in recent months and will not be defendants in the trial, scheduled for federal court in Cleveland. Like most of the others, Johnson & Johnson still faces some 2,000 other lawsuits related to the nation’s opioids epidemic.

The Ohio agreement calls for the company and its Janssen Pharmaceutical subsidiary to pay $10 million without admitting liability. The deal also includes provisions for the company to reimburse the counties up to $5 million for legal expenses and contribute another $5.4 million to nonprofit organizations that deal with the opioid crisis in northeastern Ohio.

“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,” Johnson & Johnson 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.”

Opioids, a class of drug that includes prescription painkillers as well as heroin and illicitly made fentanyl, have been linked to more than 400,000 deaths in the U.S. since 2000.

Johnson & Johnson has sold three opioids in the U.S.: Duragesic fentanyl patches; the oral opioid Nucynta; and an extended-release version of Nucynta.

The company said its products accounted for less than 1% of the opioid prescriptions in the country since they were launched. It sold marketing rights for Nucynta in 2015 and has not marketed Duragesic to patients or prescribers in the U.S. for more than a decade, although it continues to sell the drug.

In recent months, the drug companies Endo, Allergan and Mallinckrodt also reached settlements with the two Ohio counties. Purdue Pharma has struck a tentative deal intended to settle all its lawsuits — although about half the states say they will object to the settlement in bankruptcy court.

Teva is the only drugmaker that would remain in the Cleveland trial if Johnson & Johnson’s settlement is finalized. The other defendants still in the trial are distributors AmerisourceBergen, Cardinal Health, Henry Schein and McKesson, along with the pharmacy chain Walgreens.

With most drugmakers out of the initial trial, it could mean less focus on how they marketed powerful painkillers to doctors and more on whether distributors shipped opioid orders that they believed were suspicious.

With the trial approaching, more settlements are possible. In a statement Tuesday, Endo said it “continues to explore various global settlement mechanisms,” including “a construct that could potentially be implemented through Purdue Pharma’s recent bankruptcy filing.”