Apple has reached an out-of-court settlement with U.S. states and consumers in the company’s e-book price fixing lawsuit, thereby avoiding a trial that could have resulted in as much as $840 million in damages.

According to a new report by Bloomberg:

Steve Berman, a lawyer representing the plaintiffs, said by phone that all the U.S. attorneys general and consumers settled the case. Berman said he filed a memorandum of understanding with the court under seal, which prevents him from describing the agreement.

If you’ll recall, the U.S government filed the lawsuit against Apple and the so-called Big Five of publishing in April 2012, accusing the company behind iBooks of colluding with publishers in order to fix the prices of e-books. After the publishers involved settled with the U.S. Department of Justice, Apple was left as the sole defendant in the case.

Last year, a federal court ruled against Apple after a non-jury trial and set a jury trial for next month — the very same trial that the company has just avoided following today’s settlement.

A filing of the settlement, whose details are yet undisclosed, is set to be submitted by Apple and the plaintiffs for approval by a federal court within a month.

According to the filing, Apple is still intent on continuing its appeal of the earlier ruling.