An opioid manufacturer is willing to pay up billions to settle thousands of legal claims, including one filed by the State of Iowa.

Iowa Attorney General Tom Miller has been a lead negotiator for a dozen states that sued Teva Pharmaceuticals. He says the settlement is another major step in addressing the opioid crisis. Final details are still being worked out. The deal is contingent on the willingness of a generic drug manufacturer that’s associated with Teva to also strike a nationwide settlement.

Still, Teva executives have announced the company’s willing to pay up to $3.7 billion in cash over a 13 year period. Teva, which is based in Israel, will also provide $1.2 billion worth of a drug that reverses opioid overdoses. Miller says the settlement will help cover treatment for opioid addiction and help prevent fatal overdoses.

Attorneys for Iowa and other states accused Teva of downplaying the risks associated with opioids and even suggesting prescribing more pills was the answer to people who were showing signs of addiction.