Apple chief Tim Cook says his company will resist a federal magistrate's order to hack its own users in connection with the investigation into the San Bernardino shootings.
In a statement posted on the company's website, Mr Cook said such a move would undermine encryption by creating a back door that could potentially be used on other devices.
His letter was a direct response to an order from US Magistrate Judge Sheri Pym for Apple to help the Obama administration break into an encrypted iPhone belonging to one of the shooters in the December attack.
The first-of-its-kind ruling was a significant victory for the Justice Department in a technology policy debate that pits digital privacy against national security interests.
Fourteen people were killed on December 2 when a married couple opened fire on the husband's colleagues at an office lunch gathering in San Bernardino, about 60 miles east of Los Angeles.
American-born Syed Farook, 28, and his wife, Tashfeen Malik, 29, from Pakistan, pledged allegiance to a leader of the Islamic State group on Facebook moments before the shooting. Both were later killed in a gun battle with police.