Kentucky Attorney General Jack Conway has settled a lawsuit against the manufacturer of OxyContin for $24 million.

The state first filed the lawsuit back in 2007. It accused Purdue Pharma of marketing the prescription painkiller as nonaddictive because it slowly released the drug over 12 hours. But if the pill was crushed, it lost its time release qualities and created an instant high.

Kentucky officials said that led to a wave of addiction and increased medical costs across the state. Purdue Pharma replaced the drug with a new version in 2010.

The agreement says Purdue Pharma will pay Kentucky $12 million followed by another $12 million over the next eight years. The court ordered Kentucky to spend the money on addiction treatment programs.

Purdue Pharma did not admit any wrongdoing.