WASHINGTON (AP) — McKinsey & Company consulting firm has agreed to pay $650 million to settle a federal investigation into its work for opioids manufacturer Purdue Pharma, according to court papers filed in Virginia on Friday.

McKinsey has also entered into a deferred prosecution agreement to resolve criminal charges, including that it conspired with Purdue Pharma to aid in the misbranding of prescription drugs.

A former McKinsey senior partner has also agreed to plead guilty to obstruction of justice charges, according to the court papers.

McKinsey representatives didn’t immediately respond to phone and email messages on Friday.