The Oklahoma attorney general and Purdue Pharma have agreed to a $270 million settlement to resolve claims that the company played a major role in creating the nationwide opioid crisis.

The announcement Tuesday from Oklahoma Attorney General Michael Hunter comes several weeks after news broke that Purdue was exploring bankruptcy to address its growing liabilities over the opioid epidemic.

During a press conference Tuesday, Hunter said the money will provide funding for treatment across the state and nationally.

“We are out of time with regard to the responsibility we have to deal with this crisis,” Hunter said.

According to Hunter, the settlement will provide $125 million to the Oklahoma State University Center for Health Sciences, Center for Wellness & Recovery, with an additional $15 million annually for the next five years, to establish an endowment fund. Hunter said an additional $12 million will go directly toward abatement efforts in towns and municipalities across the Sooner State.

The company will also pay $60 million to offset legal costs, Hunter said Tuesday.

The settlement was also announced the day after the Oklahoma Supreme Court denied the company’s efforts to delay what is set to be the first trial focusing on claims that opioid makers played a key role in oversupplying and overprescribing the opioid drugs. A Chapter 11 filing would halt the lawsuits, folding them into bankruptcy court. Purdue then sought to delay the trial until September, citing a “belated tidal wave of documents.”

The trial is still scheduled to begin May 28 in Oklahoma.

Hunter said Tuesday there would be court-ordered mediation in the coming weeks, but his office would continue to prepare for trial.

“We’re ready to go to trial today,” Hunter said.

The opioid cases name dozens of companies and individuals with varying alleged roles in the crisis, from drug manufacturers and distributors to doctors and clinics. Counties have spearheaded the opioid cases.

The case, filed in 2017, alleged that Purdue and two other opioid manufacturers, Johnson & Johnson’s Janssen Pharmaceuticals Inc. and Teva Pharmaceuticals USA, helped create an epidemic over the prescription painkillers by marketing them as a safe and nonaddictive treatment for chronic pain.

The case alleges that Purdue—and, more specifically, its private owners, the Sackler family—created the epidemic when they introduced OxyContin in 1996.

More than 1,600 cases are pending in a consolidated federal litigation in the U.S. District Court for the Northern District of Ohio, with Judge Dan Polster overseeing things.

Purdue’s lawyers in the case are Sanford Coats of Crowe & Dunlevy in Oklahoma City and Mark Cheffo, a partner in Dechert’s New York office.

A spokesman for Purdue did not return a call seeking comment.

Neither Teva attorney Robert McCampbell of GableGotwals in Oklahoma City, nor Johnson & Johnson’s lawyer, Benjamin Odom of Odom Sparks & Jones in Norman, Oklahoma, responded to a request for comment.