Apple's challenge of a court order to unlock an iPhone used by one of the San Bernardino killers opens up a new front in the long-running battle between technology companies and the government over encryption.
The standoff brings the sensitive issue, which has been at a stalemate in Congress, into the courts, and has abruptly shifted the policy debate on encryption.
A California magistrate on Tuesday ordered Apple to provide "reasonable technical assistance" to the US Federal Bureau of Investigation to break into an iPhone used by one of the shooters in the deadly December rampage that killed 14 people and has been linked to supporters of the Islamic State organization.
Apple quickly said it would fight the judge's order. Chief executive Tim Cook called it "an unprecedented step which threatens the security of our customers," and said the order "has implications far beyond the legal case at hand.
Apple, Google and other technology firms in recent years have stepped up encryption -- allowing only the customers to have "keys" to unlock their devices -- claiming improved security and privacy is needed to maintain confidence in the digital world.
That drive for privacy has prompted sharp objections from law enforcement and intelligence officials, who claim that criminals and extremists are able to hide their illicit activities thanks to device encryption.
"This is a clever move by the FBI to move from the legislative arena, where they were not winning, to the courts," said Joseph Hall, chief technologist at the Center for Democracy & Technology, a digital rights group.
The order raised hackles among privacy advocates, which see the potential to unleash unbridled surveillance in the United States and elsewhere.
"If the FBI can force Apple to hack into its customers' devices, then so too can every repressive regime in the rest of the world," said Alex Abdo of the American Civil Liberties Union.
But Apple also came under attack for thwarting a critical security investigation.
"Apple chose to protect a dead ISIS terrorist's privacy over the security of the American people," said Senator Tom Cotton of Arkansas, using an acronym for the Islamic State group.
"Regrettably, the position Tim Cook and Apple have taken shows that they are unwilling to compromise and that legislation is likely the only way to resolve this issue."
New York City police commissioner William Bratton welcomed the order and added, "We cannot give those seeking to harm us additional tools to keep their activity secret. I reiterate my call on Congress to act immediately in passing legislation to provide law enforcement the tools we need to keep America safe."
White House spokesman John Earnest said the White House supports the request by the FBI and Department of Justice.
"They are not asking Apple to redesign its product or to create a new backdoor to one of their products," Earnest told reporters.
"They're simply asking for something that would have an impact on this one device."