RICHMOND, Va. (WRIC) — Virginia could potentially receive $108.8 million from CVS and $117.4 million from Walgreens as a result of recent opioid settlements totaling $10 billion with state and local governments across the country.

“Thousands of Virginians are struggling with opioid addiction,” Attorney General Jason Miyares said. “These opioid settlement funds play an important role in providing resources to fight back against the epidemic, including prevention practices, harm reduction, and treatment services.”

According to Miyares, CVS and Walgreens — along with Walmart previously — have agreed to court-ordered conditions that will require the pharmacies to monitor, report, and share data about suspicious activity related to opioid prescriptions.

Each state now has until the end of 2022 to review the terms of the settlement.

In total, CVS will pay $5 billion and Walgreens will pay $5.7 billion as part of the settlements, totaling a payout of $10.7 billion. Most of Walmart’s payments will be made during the first year, CVS payments will be spread out over 10 years and Walgreens payments will be spread over 15 years.