Home Depot has agreed to pay $8 million to settle claims in California that it sold thousands of gallons of paint and other coatings that did not comply with local air quality standards.

The Atlanta-based home improvement retailer was accused of selling the coatings with prohibited levels of smog-forming “volatile organic compounds” from 2009 to 2010. Combined with with nitrogen oxides, the VOCs form ground-level ozone, a pollutant responsible for a range of health problems.

The claims were made in a suit filed in June 2011 by the South Coast Air Quality Management District and the district attorneys of Los Angeles, Orange, Riverside and San Bernardino counties. South Coast is the air pollution control agency for the counties.

Home Depot will pay $1.98 million to the agency and about $6 million to the counties, the agency said.

Stephen Holmes, a Home Depot spokesman, said the retailer pulled the products when it was alerted to the problem and agreed to settle because “it was the most prudent business decision rather than a prolonged legal battle.”

The coatings are commonly sold in stores under a variety of brand names in metro Atlanta and across the U.S. The retailer has faced issues in Southern California because of more stringent air quality standards there.

Holmes said the coatings may have ended up on store shelves for a variety of reasons, including vendors’ not being aware of the local restrictions. The retailer hasn’t had issues in other parts of California.

“Our environmental program for safe handling and disposal of products that are deemed hazmat is considered industry leading,” Holmes said. “It’s been closely modeled by several other big-box retailers and benchmarked regularly. We’ve been on the forefront of introducing low VOC and no VOC products.”

The counties accused Home Depot of selling clear wood finishes, acrylic paints, sealers, lacquers, roof coatings, primers and base paints that violated air quality standards. The chain continued to sell the products even after being warned to stop claiming to have complied, the agency alleged.

“Paints and other coatings are one of our largest sources of air pollution,” Barry Wallerstein, executive officer of the air quality agency, said in a statement. “Since the Southland has the most severe air pollution problem in the nation, our standards limiting the polluting ingredients must be enforced.”

Home Depot has agreed to develop a new computerized tracking system to ensure that only compliant coatings are sold in the future.