(KTLA) – Pharmacy and grocery retailer CVS has been ordered to pay $6.5 million in penalties for selling expired items in its California stores, including over-the-counter drugs, baby food and infant formula.

On Thursday, Riverside County District Attorney Mike Hestrin announced that his office, as well as 11 other DA’s Offices across the state, settled a civil lawsuit against the retail chain.

The original complaint was filed in Santa Cruz County Superior Court and alleged that CVS and its subsidiaries had sold the expired items over a span of four years, despite California law that prohibits the sales of formula and baby food past its “use by” dates.

When informed of the lawsuit, CVS investigated internally and cooperated with prosecutors to identify what went wrong. The company has since established a new system to verify expiration dates, and has re-trained existing employees on the proper procedure for handling expired product.

Investigators were unable to find any proof that the sale of the expired goods caused any harm to Californians, officials said.

CVS, which owns and operates more than 800 stores in California, did not admit liability in the suit, but did agree to pay $6.5 million in legal and investigative fees.

Additionally, the company also agreed to pay $1 million in restitution to multiple California charities.