New York is set to receive more than $32 million as part of a nationwide opioid settlement with the consulting firm McKinsey & Company, Attorney General Letitia James on Thursday announced. 

The funds are part of a larger $573 million national agreement reached by attorneys general and the firm as part of an investigation into the company's role working with opioid manufacturers. 

The money will go toward funding opioid abatement programs. 

“McKinsey’s cynical and calculated marketing tactics helped fuel the opioid crisis by helping Purdue Pharma target those doctors they knew would overprescribe opioids,” James said in a statement. “They knew where the money was coming from and zeroed in on it. Under the terms of today’s agreement, the company will finally end its illegal conduct, deliver more than half a billion dollars into communities across the nation, and will never be able to help perpetrate this type of fraud and deception again."

The agreement was reached with McKinsey, 47 states, Washington D.C. and five territories. 

The company will release tens of thousands of internal documents detailing its work for OcyContin manufacturer Purdue Pharma as well as other opioid makers.