A five-year probe of 235 Wal-Mart and Sam's Club stores, distribution centers and storage facilities found they violated environmental laws.
The settlement is being called one of the largest of its kind in the United States.
The case began when investigators from the San Diego County Department of Environmental Health spotted a Wal-Mart employee dumping bleach down a drain. In Solano County, a child was found playing in a fertilizer pile left near his house.
Twenty-million dollars of the settlement will be split among prosecutors in 20 jurisdictions and 32 environmental health agencies across the state.
WalMart paid $1.6 million in costs for the investigation; $3 million will go to a fund for other environmental investigations and $3 million will be used to keep stores in compliance.
WalMart Vice President Phyllis Harris said the incidents happened at least four years ago. " Since then, we have worked closely with the state of California on a comprehensive hazardous waste plan that includes improving training programs, policies and procedures."
The settlement was signed by Superior Court Judge Linda B. Quinn in San Diego.