Apple will contest a court order to help FBI investigators access data on the phone belonging to San Bernardino gunman Syed Rizwan Farook.
The company had been ordered to help the FBI circumvent security software on Farook's iPhone, which the FBI said contained crucial information.
In a statement, Apple chief executive Tim Cook said: "The United States government has demanded that Apple take an unprecedented step which threatens the security of our customers."
"We oppose this order, which has implications far beyond the legal case at hand."
Since September 2014, data on the latest Apple devices - such as text messages and photographs - have been encrypted by default.
If a device is locked, the user's passcode is required to access the data. Entering an incorrect code 10 times will automatically erase the phone's data, if this option has been enabled.
Apple says even its own staff cannot access the data - a move the company made following the Edward Snowden revelations into government surveillance.
The FBI has asked Apple to do two things.
Firstly, it wants the company to alter Farook's iPhone so that investigators can make unlimited attempts at the passcode without the risk of erasing the data.
Secondly, it wants Apple to help implement a way to rapidly try different passcode combinations, to save tapping in each one manually.
The FBI wants to use what is known as a "brute force" attack, trying out every combination until stumbling across the correct one and unlocking the phone.
Farook is understood to have used a four-digit passcode which means there are 10,000 possible combinations.
"It's difficult to say with any degree of certainty - Apple does not disclose enough about its operating system to know.
Other secure products such as smart cards are designed so that the security cannot be changed after they leave the factory.
Some devices such as bank computers wipe themselves if you try to change the software.
But phones are not designed primarily from a security perspective.
It's possible that forcing a new version of iOS onto the phone would wipe it. Apple may have designed it in this way - and it would certainly be the more secure way to do it."
Apple said the FBI's demands set "a dangerous precedent".
"The FBI wants us to make a new version of the iPhone operating system, circumventing several important security features, and install it on an iPhone recovered during the investigation," wrote Mr Cook.
"The government is asking Apple to hack our own users and undermine decades of security advancements that protect our customers.
"Opposing this order is not something we take lightly. We feel we must speak up in the face of what we see as an overreach by the US government."
Farook and his wife killed 14 people in the California city last December before police fatally shot them.
Apple decided to enable encryption by default to avoid precisely this kind of ethical dilemma.
If it was impossible to access the data, the courts wouldn't even ask - so this approach by the FBI may have taken them by surprise.
What is striking about Apple's letter is that it does not say whether or not the court's demand is technically possible.
In fighting the court order, Apple will have the support of its technology peers, and perhaps the majority of its users.
For the FBI, yet more frustration over an issue it feels Apple's skilled developers should be able to solve safely.
"We have no sympathy for terrorists," said Mr Cook.
"We are challenging the FBI's demands with the deepest respect for American democracy and a love of our country."
Latest Stories
-
Jean Mensa must step down as EC Chair – APC and Movement for Change assert
19 minutes -
Akufo-Addo calls on police to refine strategies to avoid prolonged electoral unrest
23 minutes -
Only NPP looting brigade unhappy about ORAL – Ablakwa
25 minutes -
CSIR-SARI introduces integrated soil fertility management technology to boost maize production
26 minutes -
Ghana’s indigenous agribusiness faces challenges impacting economic growth – Dr. Azinu
28 minutes -
41-year-old man arrested over illegal power connection
30 minutes -
65-year-old man plans to walk over 250-km Kumasi-Accra journey for Mahama’s swearing-in
31 minutes -
Woman dies after being set on fire on NYC subway
2 hours -
Elon Musk’s curious fixation with Britain
2 hours -
EBID wins the Africa Sustainability Award
4 hours -
Expansion Drive: Takoradi Technical University increases faculties
8 hours -
SHS heads demand payment of outstanding funds before reopening of schools
9 hours -
We thank God for the 2024 general elections – Akufo-Addo
9 hours -
Coconut Grove Beach Resort marks 30 years of excellence with memorable 9 lessons & carols service
9 hours -
WAFU B U-17 Girls’ Cup: Black Maidens beat Nigeria on penalties to win inaugral tournament
10 hours