Image copyright Getty Images Image caption A judge had previously found Apple guilty of e-book price fixing in July 2013 but the case is on appeal

Technology giant Apple has agreed to pay as much as $400m (£233m) to settle a lawsuit into accusations that it colluded with publishers to fix the price of e-books.

The settlement depends on Apple losing an appeal into a 2013 ruling that it violated anti-trust laws over pricing.

That ruling found Apple orchestrated "a conspiracy with five publishers to artificially raise e-book prices".

Apple has continued to deny that it engaged in any wrongdoing.

"We did nothing wrong and we believe a fair assessment of the facts will show it," Kristin Huguet, an Apple spokeswoman, said.

If approved by a judge, the $400m will go to consumers. Apple will pay an additional $20m in legal fees.

"In a major victory, our settlement has the potential to result in Apple paying hundreds of millions of dollars to consumers to compensate them for paying unlawfully inflated e-book price," said New York Attorney General Eric Schneiderman, who announced the settlement ahead of a damages trial that was set to begin on 25 August.

There, lawyers representing consumers and 33 US states, were to request $840m in damages be awarded to consumers who were negatively impacted by the alleged higher prices for e-books.

The publishers who are accused of colluding with Apple - Hachette Book Group, HarperCollins Publishers, Penguin Group (USA) Inc, Macmillan and Simon & Schuster Inc - have already settled for $166m in a separate suit.

The settlement had previously been announced in late June but the details had not been released.