NEW YORK (AP) -- Apple will pay up to $400 million to compensate consumers ensnared in a plot to raise the prices of digital books unless the company overturns a court decision attesting to its pivotal role in the collusion.

The terms of the settlement disclosed in a Wednesday court filing came a month after the attorney suing Apple notified U.S. District Judge Denise Cote that an agreement had been reached to avert a trial.

Lawsuits filed on behalf of digital book buyers had been seeking damages of up to $840 million for a price-fixing scheme that Cote ruled had been orchestrated by Apple

Apple is appealing Cote's decision. The Cupertino, Calif., company won't have to pay the $400 million settlement if it prevails.

Five major book publishers previously reached settlements totaling $166 million.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.