Consulting firm McKinsey & Company has agreed to pay a settlement of $573 million for its role in the opioid crisis in America and the advice given to OxyContin maker Purdue Pharma to market the highly addictive painkiller.

McKinsey is required to pay out $478 million within the first 60 days, The New York Times reports. The remaining balance of the settlement will be paid out over four yearly payments beginning in 2022.

As part of the settlement, McKinsey won’t admit to wrongdoing but will abide by court-ordered restrictions barring the company from work involving certain types of addictive narcotics.

McKinsey will also be required to make tens of thousands of pages of documents related to its opioid work available on a public database and keep emails for five years as part of the ongoing investigation into the opioid crisis.

On Thursday, McKinsey issued a statement claiming it believed “its past work was lawful and has denied allegations to the contrary.”

The settlement comes after 47 states, the District of Columbia and five territories filed lawsuits accusing drugmakers of intentionally marketing the painkiller and ignoring red flags about the inappropriate way OxyContin prescriptions were being used, Reuters reports.

One of the memos showed McKinsey advising Purdue Pharma to focus on health care providers that had high records of prescribing OxyContin and avoid those with lower statistics.

In 2019, Purdue Pharma filed for bankruptcy as part of a $10 billion settlement that accused the drugmaker’s marketing of OxyContin of fueling the opioid crisis across the country.

From 1999 to 2018, there have been around 450,000 overdose deaths reported. Over 3,200 lawsuits are pending against pharmacies, drugmakers, and distributors for their contribution to the opioid addiction epidemic.

States that receive portions of the settlement money are expected to use the funds for opioid recovery, treatments, and prevention programs.

Almost half a million Americans have died in overdoses from both prescription and illegal opioids between 1999 and 2018
Almost half a million Americans have died in overdoses from both prescription and illegal opioids between 1999 and 2018 US Drug Enforcement Administration / Handout