The Apple logo is lit on the first day of sale for the iPhone 6 and iPhone 6 Plus, in Sydney September 19, 2014.

A U.S. judge on Friday gave final approval to Apple Inc's agreement to pay $450 million to resolve claims it harmed consumers by conspiring with five publishers to raise e-book prices.

During a hearing in Manhattan, U.S. District Judge Denise Cote approved what she called a "highly unusual" accord. It calls for Apple to pay $400 million to as many as 23 million consumers if the company is unsuccessful in appealing a ruling that found it liable for antitrust violations.

The $400 million comes on top of earlier settlements with five publishers in the case, which provided $166 million for e-book purchasers.

Apple agreed to the settlement in June, ahead of a damages trial set for two months later in which attorneys general in 33 states and territories and lawyers for a class of consumers were expected to seek up to $840 million.

During Friday's hearing, Cote said it was an "unusually structured settlement, especially for one arrived at on the eve of trial."

The deal allows Apple to continue to appeal Cote's July 2013 ruling that Apple had violated antitrust laws by colluding with the publishers to drive up e-book prices and impede rivals such as Amazon.com Inc.

That accord calls for Apple to pay $400 million to consumers and $50 million to lawyers if Cote's findings are upheld on appeal, and nothing if the Cupertino, California-based company wins its appeal.

If the appeals court overturns Cote and returns the case to her, perhaps for a new trial, Apple would owe $50 million to consumers and $20 million to lawyers.

While the deal was unusual, Cote said she understood why the plaintiffs decided to go with it, given delay tactics by Apple.

An Apple spokesman did not respond to a request for comment.

The ruling finding Apple liable followed a non-jury trial in lawsuits filed in 2012 by the U.S. Justice Department and states attorneys general against Apple and the publishers.