Target has reached a $7.4 million lawsuit with the state of California over allegations that the company improperly dumped hazardous materials between 2012 and 2016.

California Attorney General Havier Becerra said Wednesday that the mega-chain would have to pay $3.2 million in fines, and an additional $3 million will go toward compliance inspections and audits of its trash facilities. Target will also fund environmental projects as part of the settlement.

The state and 24 local governments alleged that between 2012 and 2016, Target mishandled hazardous waste ranging from batteries and aerosol cans to fluorescent light bulbs.

“Target’s ongoing and improper disposal of hazardous waste and contaminants harmed the public and the environment,” Becerra said in a statement.

According to Becerra’s statement, Target was accused of violating state laws and “injunctive terms” from a previous lawsuit in 2011 because of the findings.

“We are confident that with these strong injunctive terms and penalties, Target will implement meaningful changes to prevent this from ever happening again,” Becerra said. “However, the wise move for all companies is to abide by the law and employ proactive training and processes to help ensure that hazardous waste violations are avoided in the first place.”

This is the second settlement of allegations that Target violated hazardous waste rules. Under the 2011 settlement, Target agreed to pay $22.5 million in penalties, court fees and environmental funding.