Apple has officially committed to at least 5 years of iPhone security updates. Samsung and Google offer two extra years for Android updates.

Apple has committed to at least five years of security updates for the iPhone models after they went on sale. That’s a minimum support lifetime, but Apple is known for supporting even older devices with security fixes.
Apple responded to the United Kingdom’s new Product Security and Telecommunications Infrastructure (PSTI) regulations requiring companies that sell internet-capable products in the country to continue providing software updates for years after a product’s debut. The new regulation came into effect on April 29, 2024.
The organization denies security updates as software updates that “protect or enhance the security of a product, including a software update that addresses security issues which have been discovered by or reported to the manufacturer.”
Apple’s filing for the iPhone 15 Pro Max [PDF document] reveals the defined support period of at least five years from the first supply date (September 22, 2023).
A minimum support lifetime for the iPhone is 5 years
However, as the Android Authority points out, Google and Samsung offer two years longer security updates for Android and at least seven years of Android OS updates.
This is the first time Apple has defined how it supports people who hold onto their devices much longer than your typical consumer. On average, people upgrade their iPhones every three years. In the past, Apple used to support devices older than five years with iOS updates, but it now seems the new cut-off period is five years.
Note that there’s a distinction between security updates and iOS updates. The oldest device that iOS 17 runs on is the iPhone Xs/Xr, released six years ago in 2018. However, Apple still releases bug-fix updates with critical patches for older devices.
Apple often supports legacy devices beyond 5 years
For example, iOS 15.8.1 released in February 2024 with security fixes for older iPhones dating as far back as the iPhone 6s, a nine-year old phone. The iPhone 6s received seven major iOS updates, from iOS 9 to iOS 15.
In November 2020, a security update patched security vulnerabilities on the iPhone 5s, a phone related seven years ago in 2013. That phone received six years of major iOS updates, from iOS 7 to iOS 12.
Long-term software support is one of the reasons Apple users prefer the iPhone over Android. Interestingly, Apple doesn’t want to guarantee the same seven years of support for iPhones as Macs.