SAN FRANCISCO – Walmart Stores Inc. will pay $81 million after pleading guilty to criminal charges the company dumped hazardous waste across California, a company spokeswoman said Tuesday.

Walmart entered the plea in San Francisco federal court to misdemeanor counts of negligently dumping pollutants from its stores into sanitation drains across the state, spokeswoman Brooke Buchanan said. As part of the plea, the company will pay the substantial fine that also will cover charges in Missouri.

The plea agreements announced Tuesday end a nearly decade-old investigation involving more than 20 prosecutors and 32 environmental groups.

In 2010, the company agreed to pay $27.6 million to settle similar allegations made by California authorities that led to the overhaul of its hazardous waste compliance program nationwide. The state investigation began eight years ago when a San Diego County health department employee saw a worker pouring bleach down a drain.

“We have fixed the problem,” Buchanan said. “We are obviously happy that this is the final resolution.”

Court documents show the illegal dumping occurred in 16 California counties between 2003 and 2005. Federal prosecutors said the company didn’t train its employees.