Walmart has agreed to stop selling lawn fertilizers containing phosphorus in New York after the state accused the company of repeatedly violating a law aimed at reducing water pollution, the state attorney general's office announced Thursday.

The retail giant also will pay $98,000 in penalties under the agreement with Attorney General Eric T. Schneiderman's office, which stems from an investigation into the sale of the fertilizers at 18 Walmart stores statewide.

Of those, 16 -- including three in Nassau County -- sold the phosphorus-containing fertilizers either next to phosphorus-free fertilizers, which is against state law, or without posting required signs informing purchasers about restrictions on use of the products, Schneiderman's office said.

More coverageWater quality on Long Island

"The law requires retailers to help consumers avoid lawn fertilizers that can harm the public and our environment," Schneiderman said in a statement.

Under state law, lawn fertilizers containing phosphorus can only be used on lawns and nonagricultural turf if a soil test indicates a phosphorus deficiency or if it's a new lawn during its first growing season.

Phosphorus runoff from fertilizers can wash into surrounding waterways, contributing to harmful algal blooms that can poison wildlife and create toxins dangerous to humans. In 2012, a blue-green algal bloom in the freshwater Georgica Pond in East Hampton was found to be responsible for the death of a Jack Russell terrier.

advertisement | advertise on newsday

In the agreement finalized last Friday, the company did not admit to or deny the attorney general's allegations.

Walmart spokesman Randy Hargrove said Thursday the company was "pleased to resolve this matter."

"If we resume the sales of this fertilizer in the future, we will display the state-required informational signage," he said.

Adrienne Esposito, executive director of Citizens Campaign for the Environment, hailed what she called "a great agreement."

"We always knew it was a problem," Esposito said of phosphorus runoff. "Harmful algal blooms are increasing quickly, and they're dangerous and we need to stop their food source."

The attorney general's office inspected the stores, including Walmart locations in Uniondale, Westbury and Valley Stream, in June and July, and conducted follow-up investigations at four other stores in September.

The state notified Walmart of the allegations in December, leading to settlement negotiations that resulted in the agreement.

In addition to Walmart stores in New York, the retailer agreed to stop selling the fertilizers at Sam's Club stores in the state and on its website to New York customers, according to the Assurance of Discontinuance document.

advertisement | advertise on newsday

If Walmart resumes the sale of phosphorus-containing lawn fertilizers, it must inform the attorney general's office 60 days in advance, and must detail the efforts it will take to comply with the state law. The agreement is in effect for three years.