The grocery chain Whole Foods will pay $7.4 million to settle a class-action antitrust lawsuit that alleged that it systematically overcharged customers for its grocery services.

The settlement was announced Wednesday by the U.S. Justice Department’s Antitrust Division and the Federal Trade Commission.

The case was filed in 2014 by the Competitive Enterprise Institute, which is a nonprofit advocacy group that seeks to prevent the concentration of power in Washington.

The complaint alleged that the company charged consumers in violation of the Sherman Antitailing Clause of the Clayton Act, a 1906 law that prohibits unfair business practices, and the Fairness Doctrine, a 1982 law that protects consumers.

The antitrust complaint alleged the company failed to act to curb price gouging, including the sale of discounted products to customers who couldn’t afford them.

“The FTC believes the settlement is a necessary step in our ongoing efforts to restore consumer confidence in grocery stores and protect consumers from price-gouging,” said Christopher M. Hayes, director of the Antitraining Division.

“We will vigorously enforce the antitrust laws to ensure that all Americans have access to affordable grocery and other products at competitive prices.”

The settlement follows the Federal Circuit’s April 2015 ruling in Whole Foods’ favor.

In that ruling, the court noted that a plaintiff must prove that a competitor’s pricing practices caused a substantial and objectively unreasonable loss to consumers.

Under the settlement, the FTC and the Justice Department will now conduct an investigation to determine whether the company violated antitrust laws.