Well, that was fast.

A settlement has been reached just two days after District Attorneys from 25 California counties filed a lawsuit against Tesla over allegations the automaker repeatedly mishandled hazardous waste at its facilities throughout the state.

Tesla has agreed to pay $1.3 million in civil penalties and $200,000 to reimburse the costs of the investigation, according to a press release from the Office of the District Attorney in San Francisco. Tesla is also under a detailed injunction for five years, which requires training employees and hiring a third party to conduct annual waste audits of its trash containers at 10% of its facilities. These audits will occur each year for five years and auditors will examine trash containers for hazardous waste, according to the joint release sent Thursday evening.

Tesla owns 57 car service centers and 18 solar energy facilities throughout California and makes It also manufactures electric vehicles at its Fremont Factory in Alameda County.

The San Francisco District Attorneys’ office did not respond to a request for comment on what prompted the fast turnaround. TechCrunch will update the story is the SFDA responds.

“While electric vehicles may benefit the environment, the manufacturing and servicing of these vehicles still generates many harmful waste streams,” San Francisco District Attorney Brooke Jenkins said in a statement. “Today’s settlement against Tesla Inc. serves to provide a cleaner environment for citizens throughout the state by preventing the contamination of our precious natural resources when hazardous waste is mismanaged and unlawfully disposed. We are proud to work with our district attorney partners to enforce California’s environmental laws to ensure these hazardous wastes are handled properly.”

The complaint, filed January 30 in San Joaquin County Superior Court, stated that Tesla improperly labeled and disposed of materials like “lead acid batteries and other batteries,” paints, brake fluid, aerosols, antifreeze, acetone, diesel fuel and more at its production and service facilities throughout the state. Tesla also allegedly improperly disposed of the waste, both on-site and at landfills that can’t accept hazardous waste, according to the lawsuits.

While the lawsuit was just filed a day ago, the environmental investigation has been a six-year effort.

The San Francisco District Attorney’s Office Environmental Division initiated an investigation in 2018 when San Francisco District Attorney investigators conducted undercover inspections of Tesla’s trash containers at its car service centers, according to prosecutors. The inspections revealed the illegal disposal of numerous used hazardous automotive components such as lubricating oils, brake cleaners and antifreeze.

The discovery prompted additional inspections at Tesla car service centers and eventually to the trash containers at the automaker’s factory in Fremont, where they found an unlawful disposal of additional hazardous wastes, including metal car panel welding spatter waste (which can contain copper), waste paint mix cups produced during paint repair and wipes/debris contaminated with primer.

Tesla did cooperate with the investigation and took steps to improve its compliance, the San Francisco DA’s office said in a joint press release. Settlement talks had been underway prior to the lawsuit.