San Francisco (CNN Business) Apple will pay up to half a billion dollars to settle a class action lawsuit accusing it of slowing down older iPhone models to compel users to buy new ones.

Apple AAPL The proposed settlement agreement requiresto pay the owners of certain iPhone models $25 per affected device, totaling a minimum of $310 million and a maximum of $500 million, according to documents released on Friday in US District Court in San Jose, California. The amount each user receives could increase or decrease depending on how many claims are filed as well as any additional legal fees and expenses approved by the court, the document added.

The settlement agreement, which is subject to approval by a judge on April 3, caps a legal battle that's gone on for more than two years during which Apple tried to ease a global backlash

that Apple did so to force users to upgrade to the latest iPhone model, but the company said it was aimed at addressing issues with older lithium-ion batteries that would make the phones suddenly shut down to protect their components. The company admitted in December 2017 that it used software updates to slow down older iPhones, soon after angry customers and tech analysts flagged that the updates were causing diminished performance. Some of them suggested that Apple did so to force users to upgrade to the latest iPhone model, but the company said it was aimed at addressing issues with older lithium-ion batteries that would make the phones suddenly shut down to protect their components.

Read More