(Bloomberg) -- Walgreens Boots Alliance Inc. has agreed to pay $230 million to resolve claims by San Francisco that the pharmacy owner mishandled opioid painkillers.

San Francisco City Attorney David Chiu announced the settlement Wednesday nine months after a federal judge found Walgreens liable for dispensing hundreds of thousands of red-flag prescriptions that resulted in overdoses, death, and city streets being littered with drug paraphernalia.

Attorneys for the city said in October that Walgreens owes $8.1 billion over 15 years for costs to mend damage from the opioid crisis.

Read More: Walgreens Liable for Opioid-Fueled Nuisance in San Francisco

More than 3,000 state and local governments have sued opioid makers, distributors and sellers seeking compensation for billions of tax dollars spent battling the public-health crisis spawned by the painkillers. Total recoveries across the US are expected to exceed $50 billion once all payments are made.

The case is City and County of San Francisco v. Purdue Pharma L.P., US District Court, Northern District of California (San Francisco).

©2023 Bloomberg L.P.