The U.S. Department of Justice announced Wednesday it had closed criminal and civil investigations with Purdue Pharma and that the company had agreed to plead guilty in New Jersey federal court to three federal criminal charges and pay more than $8 billion.

The resolution with the Big Pharma company, which has been under scrutiny from the federal government and dozens of attorneys general for how it marketed opioids, specifically OxyContin, is subject to the approval of a bankruptcy court.