SAN FRANCISCO (AP)  AT&T agreed Thursday to pay California authorities nearly $24 million to settle allegations that it improperly disposed of hazardous waste during a nine-year period.

California Attorney General Kamala Harris said Thursday that the telecommunications giant has also agreed to spend $28 million over the next five years to properly dispose of the waste, which includes batteries, electronic equipment and various gels and liquids. The investigation began in 2011 when inspectors with the Alameda County District Attorney”s office and the California Department of Toxic Substances Control examined trash bins outside about 235 AT&T warehouse and other facilities, Harris said.

Harris and Alameda County District Attorney Nancy O”Malley filed a lawsuit Thursday in Oakland, the same day the settlement was announced.

“Today”s settlement marks a great victory for California”s ongoing efforts to ensure that hazardous waste is disposed of in a safe, legal and environmentally sustainable manner,” O”Malley said. “This legal action should put others on notice that local and state agencies will continue to work together to investigate and prosecute violations against our environment.”

A judge still must approve the settlement.

“We take environmental stewardship seriously, and we”ve cooperated closely with the state and Alameda County to resolve this issue in a way that is in the best interests of the environment, our customers and all Californians,” AT&T spokesman Marty Richter said. “The settlement recognizes the company for taking prompt action, dedicating significant additional resources toward environmental compliance, and improving our hazardous and universal waste management compliance programs.”

Five other telecommunications” companies have disclosed in financial filings with regulators that they are the targets of similar investigations.