SACRAMENTO, Calif. — Retail giant Walmart illegally dumps more than 1 million batteries, aerosol cans of insect killer and other products, toxic cleaning supplies, electronic waste, latex paints and other hazardous waste into California landfills each year, state prosecutors alleged this week in a lawsuit that the company labeled “unjustified.”

“As we shop the brightly packed aisles, there are products that will never make it into the cart — returned, damaged or pulled from the shelves for a variety of reasons,” said California Attorney General Rob Bonta.

The attorney general’s office settled a previous similar lawsuit in 2010 in which Walmart, which operates more than 300 stores in California, paid $25 million and agreed to stop the dumping into local landfills that are not equipped to contain the hazardous products.

It paid $1.25 million to Missouri in 2012 to settle a similar lawsuit.

And in 2013, the company pleaded guilty to six federal misdemeanors of negligently discharging a pollutant into drains in 16 California counties, part of an $81 million deal that also included charges in Missouri.

Company spokesman Randy Hargrove said Walmart will fight the “unjustified lawsuit” filed Monday.

“The state is demanding a level of compliance regarding waste disposal from our stores of common household products and other items that goes beyond what is required by law,” Hargrove said. He said a judge was ready to sign off in 2018 on Walmart’s compliance under the 2010 settlement until the attorney general’s office started a new investigation with “new rules” in a bid to force a new settlement.

More than 3,800 audits overseen by the attorney general’s office since 2010 found that Walmart’s trash compactors “contain at most 0.4% of items of potential concern,” compared to a statewide average of 3%.

Bonta said Walmart’s own inspections show it illegally disposes of nearly 80 tons of such waste each year, which his office estimated amounts to more than 1 million individual items.

“Pesticides, electronics, household hazardous waste must be disposed of properly, or they can be released into our air, our water and soil resulting in a number of negative health outcomes — including cancer, neurological disorders, asthma or learning disabilities,” California Department of Toxic Substances Control Director Meredith Williams said at a news conference announcing the lawsuit.

The state did 58 inspections in 13 counties of trash compactors taken from Walmart stores from 2015 to this year. In every case they found dozens of products that count as hazardous waste, medical waste or customer records with personal information, Bonta said.

By contrast with Walmart, Bonta said other large retailers have disposal practices that comply with state laws “to different degrees, some with great compliance.”