Tesla has settled a lawsuit over hazardous waste at its facilities in California, reports TechCrunch.

The lawsuit was filed by 25 counties in the state. The parties have now reached a settlement agreement under which the automaker will pay a $1.5 million fine.

This amount consists of a $1.3 million civil penalty and another $200 thousand as reimbursement for the costs of the investigation.

Under the terms of the agreement, Tesla will also have to provide training for its employees and undergo annual hazardous waste inspections. These will be conducted by independent representatives at some of the company’s facilities over the next five years.

Earlier, some California counties accused Tesla of mishandling hazardous waste at its facilities across the state. The lawsuit alleged that violations occurred at 101 facilities, including Tesla’s Fremont plant.

The carmaker was accused of violating the state’s unfair business practices and hazardous waste management laws by improperly labeling waste and sending it to landfills that cannot accept hazardous materials.