Target Corp. agreed to a $5 million settlement to a California consumer protection lawsuit that alleged it charged customers prices higher than advertised and that prices on its mobile app changed when customers entered stores.

The San Diego County District Attorney's Office filed the complaint in February and announced the settlement in March.

This isn't the first time that the San Diego office has brought complaints against Minneapolis-based Target. In 2018, Target settled with that office for $7.4 million over allegations it violated California laws regarding the handling and disposal of retail hazardous waste.

"With this latest lawsuit, we're continuing to protect consumers and their hard-earned money, as well as ensuring that Target is held responsible when it violates the law," San Diego County District Attorney Summer Stephan said in a statement.

In the most recent complaint, prosecutors zeroed in on a technology called "geofencing" that lets businesses identify where consumers are and make their apps adapt to that location.

The San Diego prosecutors objected to the way Target's pricing changed, saying that the retailer didn't clearly disclose to customers where some items could be purchased for the advertised price either online or in store.

The settlement prevents Target from using geofencing to raise the price of an item. Target is also supposed to clearly display on the app where a customer can obtain the item at the price advertised, whether online or in store.

In California, Target has to go a step further and implement additional audit and price accuracy procedures in its stores for a seven-year period.

The San Diego County District Attorney's Office said Target cooperated and took steps to improve pricing accuracy. Target said geofencing is not currently used to impact prices.

"Target is committed to providing value to our guests, and that includes accurate pricing in our stores and online," Target said in a statement. "We've taken steps to improve our processes because the majority of these issues in California occurred when promotional signs were not removed immediately after a promotion ended. If guests have questions, they can bring their receipt to the guest service desk to discuss a price adjustment."