Judge Thad Balkman listens to Attorney General Mike Hunter speak during opening statements during the Oklahoma v. Johnson & Johnson opioid trial at the Cleveland County Courthouse in Norman, Okla., on May 28. (Chris Landsberger/Pool via Reuters)

Oklahoma officials have agreed to spend tens of millions of dollars from an out-of-court settlement solely to curb opioid abuse in the state, ending a conflict among state leaders over who would control the money.

After receiving the assurances before a brief court hearing Monday, Oklahoma state judge Thad Balkman approved the $85 million settlement between the state and Teva Pharmaceutical Industries. Private attorneys hired by the state to work on the case will receive 15 percent of the total, plus reimbursement for their expenses.

“The resources and terms of the agreement will help abate the ongoing crisis the state is facing,” state Attorney General Mike Hunter (R) said in a statement released after the hearing.

Teva is one of three pharmaceutical companies that Oklahoma sued two years ago in what has become a closely watched first test of whether states and cities can force drug firms to help pay for the two-decade-old opioid crisis. Almost every state has filed suit against drug companies in state courts, and about 1,900 cities, towns, Native American tribes and other groups have sued pharmaceutical companies in a huge consolidated case that is before a federal judge in Ohio.

In March, Oklahoma reached a $270 million settlement with Purdue Pharma, maker of the drug OxyContin. Balkman is presiding over the trial — now in its fifth week — against the remaining defendant, health-care conglomerate Johnson & Johnson .

The Teva deal was announced May 26, but the company’s payment to the state was held up after Gov. Kevin Stitt (R) and leaders of the state House and Senate sought clarification about who would control the money.

After most of the money from the Purdue agreement went to a national addiction treatment and research center at Oklahoma State University, unhappy state lawmakers passed legislation requiring that any future settlement revenue go into the state treasury.

But a lawyer for the state suggested at a June 10 court hearing that the money should remain under Balkman’s control until the state knows how much it might win from Johnson & Johnson. The governor and top legislators filed a motion in court to ensure that the state law was followed.

Some anti-drug advocates had worried that the state might spend the money elsewhere.

Balkman ordered all the parties to a mediation session last week before a retired state Supreme Court justice, where the agreement was reached. According to the deal announced Monday, the money will be deposited in a state “opioid lawsuit settlement fund” and “shall only be for the abatement of the nuisance related to the opioid crisis,” with the legislature making specific appropriations.

Under the terms of the agreement, Teva will pay the money within three days. The company, which admitted no wrongdoing, is barred from promoting its drugs through sales visits or experts through 2026.