(CNN) Purdue Pharma has agreed to pay $270 million to settle a historic lawsuit brought by the Oklahoma attorney general, who accused the OxyContin maker of aggressively marketing the opioid painkiller and fueling a drug epidemic that left thousands dead in the state.

The settlement comes after Purdue fought the attorney general in court, seeking to delay the start of the trial, which is scheduled for May 28.

"It is a new day in Oklahoma, and for the nation, in our battle against addiction and the opioid epidemic," Attorney General Mike Hunter said Tuesday in Tulsa.

Hunter said that $102.5 million of the settlement would be used to help establish a national addiction treatment and research center at Oklahoma State University, with additional payments of $15 million each year for the next five years beginning in 2020. The company will also provide $20 million of addiction treatment and opioid rescue medications to the center over the same five-year time frame.

A remaining $12.5 million from the settlement will be used directly to help cities and counties with the opioid crisis.

Read More