In 2013, a judge ruled that Apple had engaged in a price-fixing conspiracy over the price of e-books. It used the "agency model" in an effort to compel Amazon to raise the price of e-books, when many were selling for $9.99.

The ruling by US District Judge Denise Cote led to a class-action lawsuit being filed against Apple over the same issue. The class was certified in March, and state attorneys general also became plaintiffs on the case, which is set for trial next month.

Now, Bloomberg has reported that Apple has struck a settlement to avoid that trial, which could have been an unpleasant and expensive shooting-fish-in-a-barrel situation. Instead, Apple will pay an undisclosed amount to consumers who paid unfairly high prices for e-books.

Apple is tacitly admitting that it wouldn't fare well at a trial. That's a smart move, considering it would face a jury that would likely hear about the US government win and the same judge who already found that the company had broken laws. The plaintiffs were seeking as much as $800 million.

But there's an unusual "hook" to the settlement. Apple still believes it will win on appeal, and the payment it agrees to today will apparently be reversed if it does. The company has argued on appeal that higher prices improved competition in the e-book market.

In a letter to the judge (PDF) about the settlement, the parties note that Apple has appealed Cote's earlier ruling and that "a bona fide justiciable dispute remains" as to whether that ruling was proper or not. "[A]ny payment to be made by Apple under the settlement agreement will be contingent on the outcome of that appeal," the letter explains.

Essentially, Apple is admitting that it can't win this case as long as it lost its case against the government, and the plaintiffs are admitting that if the government's case doesn't stand, they'll have much less leverage at trial.

Apple has fought this case tooth and nail despite negative publicity, even when all the publisher co-defendants settled. It pushed ahead with—and lost—a high-profile case against the Department of Justice. Today's "settlement" shows that the company still believes it did nothing wrong.