Whole Foods Market has agreed to pay $500,000 to resolve an investigation into whether the supermarket chain charged too much for some prepackaged foods at its New York City stores, a city agency announced on Monday.

The New York City Department of Consumer Affairs said the settlement also requires the company to adhere to standards aimed at preventing overcharging.

The department's commissioner, Julie Menin, said the agreement "will help to ensure New Yorkers are better protected from overcharging."

Whole Foods, which operates nine stores in the city — in Manhattan and Brooklyn - said the settlement was below the $1.5 million the agency demanded and would "put this issue behind us so that we can continue to focus our attention on providing our New York City customers with the highest level of quality and service."

The Department of Consumer Affairs in June had announced an investigation of Whole Foods after finding its New York City stores routinely overstated the weight of prepackaged meat, dairy and other goods.

RELATED: Whole Foods' apology a little difficult to swallow for some on social media

The overcharges ranged from 80 cents for a package of pecan panko to $14.84 for a package of coconut shrimp, according to the agency, which tested 80 types of food and found that all of them had mislabeled weight.

The co-chief executives of Whole Foods, Walter Robb and John Mackey, subsequently apologized in a YouTube video, saying they "made some mistakes." The publicity that followed the probe hurt sales at the Austin, Texas-based chain.

As part of the settlement, the Department of Consumer Affairs said Whole Foods must conduct quarterly in-store audits at all its New York City stores.

If agency inspectors identify mislabled pre-packaged foods at a store, that store must immediately remove all mislabled products and Whole Foods must check the accuracy of pricing of that and 20 other products from the same department at all city stores, the department said.

Whole Foods must also implement and enforce policies preventing employees from estimating a package's weight and conduct training for employees involved in that process, the department said.

Whole Foods said in a statement that the Department of Consumer Affairs, in announcing the deal, had "misrepresented this agreement," saying the company had pre-existing programs that went "above and beyond" the agency's requirements.

Whole Foods said the settlement states that "there was no evidence of systematic or intentional misconduct by anyone in the Northeast region or the rest of the company."