BOSTON (State House News Service) – Massachusetts stands to receive $230 million under agreements reached with CVS and Walgreens resolving allegations that the companies contributed to the opioid crisis by failing to properly oversee the dispensing of opioids at their stores.

Attorney General Maura Healey announced the agreement on Monday, and it’s part of a multi-state deal totaling $10.7 billion. Healey’s office said it is the third major nationwide opioid settlement that attorneys general have announced since mid-November, and it raises the total amount from national cases against the drug industry to $50 billion.

Settlements with Walmart, Teva Pharmaceuticals and Allergan were announced in November, and Massachusetts was due $500 million under a $26 billion resolution with opioid distributors and Johnson & Johnson, which was announced in July.

CVS has agreed to pay $5 billion over 10 years and Walgreens has agreed to pay $5.7 billion over 15 years, the AG said, and CVS and Walgreens will be subject to court-ordered injunctive relief “that requires the pharmacies to monitor, report, and share data about suspicious activity related to opioid prescriptions and to implement and maintain robust compliance departments and practices.”

Healey’s office said the settlements are being sent to the states for review and approval, adding that parties “are optimistic that the settlement will gain broad support.” Local governments could then join the resolution during the first quarter of 2023 and payments are expected to then begin during the second half of 2023.

“Nearly all of the settlement funds must be used to remediate the opioid crisis, including prevention, harm reduction, treatment, and recovery services,” Healey’s office said.