Apple says it is to change the default settings of its iPhone to stop hackers and others unlocking devices without proper legal authorisation.
The move will also make it more difficult for police to unlock handsets without authorisation.
However, Apple denied the changes were designed to thwart US law enforcement.
The company has been a prominent opponent of US legislation to force technology companies to maintain access to users' communications.
The loophole also applies to countries outside the US, including the UK.
Police forces say that being able to unlock iPhones and iPads is crucial to their work.
But in 2016 Apple refused to help police unlock a phone used by a gunman who killed 14 people in San Bernardino, California.
"We're constantly strengthening the security protections in every Apple product to help customers defend against hackers, identity thieves and intrusions into their personal data," Apple said in a statement.
"We have the greatest respect for law enforcement, and we don't design our security improvements to frustrate their efforts to do their jobs."
The changes to the default settings of the iPhone are intended to stop unauthorised access to the phones via the USB port.
In 2016, a court order demanded that Apple help the FBI unlock the phone used by San Bernardino gunman Syed Rizwan Farook.
The company resisted and the FBI eventually paid experts to develop technology that unlocked the phone.
The FBI has never named the security firm or group of hackers who did the work.