CVS Pharmacy agreed to pay $13.75 million in civil penalties to the city, county and dozens of other municipalities across California to settle a lawsuit alleging the drugstore chain illegally disposed of hazardous waste, said City Attorney Carmen Trutanich.

Prosecutors began investigating CVS in 2010 for allegedly mishandling medical, pharmaceutical and photographic waste, along with other hazardous and corrosive materials returned by customers over a seven-year period. CVS has 76 stores in Los Angeles, according to the city attorney’s office.

The Rhode Island-based company agreed to a settlement negotiated by the Ventura, Los Angeles and San Diego county district attorneys and Trutanich on behalf of 45 different jurisdictions.

“Big and small businesses alike have a legal and moral duty to protect the environment, the consumers who use their products and the communities in which they operate,” said Trutanich, who is running for district attorney. “Enforcement actions like this must be undertaken at times to remind them of that duty. I believe that CVS has learned that lesson.”

Under the agreement, Trutanich’s office and other lead negotiators will each get $950,000 in civil penalties. Dozens of fire and environmental health departments across the state will get smaller amounts for participating in the investigation.

Under the settlement agreement ordered by Ventura County Superior Court Judge Barbara Lane, CVS is permanently enjoined from violations of state environmental laws.

Assistant City Attorney Don Kass, who helped prosecute the case for the city, said CVS has put proper environmental protocols and training in place at all their stores and hired contractors to handle hazardous waste.