Apple Inc. rejected a court order to help U.S. investigators unlock an iPhone used by one of the shooters in a terrorist attack in California, setting up a pivotal confrontation with the government over the sanctity of personal information.

In a letter published on Apple’s website, Chief Executive Officer Tim Cook said the Federal Bureau of Investigation was seeking a new version of Apple’s operating system that would circumvent security features and give law enforcement access to private data. Calling the order a dangerous precedent, Cook framed it as a “chilling” attack on civil liberties and warned that ultimately the government could “demand that Apple build surveillance software to intercept your messages, access your health records or financial data, track your location, or even access your phone’s microphone or camera without your knowledge.”

Apple’s forceful reaction to the court order dramatically escalates the battle between the tech industry and the government over how much companies should cooperate in the fight against terrorism. Law enforcement authorities say they need access to private information to track terrorists like the duo who killed 14 people in San Bernardino in December; companies like Apple and Google say such a move would violate pledges to keep their customers’ data safe and hurt their businesses.

Officials also say companies such as Facebook and Twitter need to do more to keep terrorists from using social media to spread their message and recruit adherents.

‘Open It’

Apple’s opposition is already being turned into an issue on the presidential campaign trail, with Republican candidate Donald Trump telling Fox & Friends that he agrees “100 percent with the courts” and saying of Apple “Who do they think they are? They have to open it up.”

Federal investigators haven’t been able to unlock the iPhone used by Syed Rizwan Farook, who carried out the Dec. 2 shooting, the government said in a filing in federal court in Riverside, California. Farook was using an iPhone 5c owned by the San Bernardino County Department of Public Health with an iOS 9 operating system. Farook, 28, and his wife, Tashfeen Malik, 29, were killed in a gun battle with police after the attack on his co-workers.

U.S. Magistrate Judge Sheri Pym on Tuesday ordered Apple to provide “reasonable technical assistance” to the FBI to recover information from the phone.

“While we believe the FBI’s intentions are good, it would be wrong for the government to force us to build a backdoor into our products,” Cook wrote. “Ultimately, we fear that this demand would undermine the very freedoms and liberty our government is meant to protect.”

Five Days

Pym gave Apple five business days to file court papers opposing the order. The loser -- whether Apple or the Justice Department -- could then appeal to a district court judge in the same courthouse, and next to the U.S. Court of Appeals in San Francisco and ultimately the Supreme Court.

“It is unfortunate that Apple continues to refuse to assist the department in obtaining access to the phone of one of the terrorists involved in a major terror attack on U.S. soil,” the Justice Department said in a statement after Cook’s response. “The judge’s order and our request in this case do not require Apple to redesign its products, to disable encryption or to open content on the phone.”

The Justice Department hasn’t decided how far it will take the issue or whether it will seek a contempt of court charge against the company or its executives, according to an Obama administration official who requested anonymity to discuss the matter.

The government isn’t pursuing the case to seek a precedent that grants permanent access to encrypted smartphone information, the official said. Rather, investigators have a strong interest in finding out who Farook had contacted prior to the attack, the official said.

Even so, if the government prevails, the official said, that could create a path for law enforcement to acquire encrypted data that the company has previously said is out of authorities’ reach.

Apple shares rose 1.5 percent to $98.12 at the close in New York.

‘Big Problem’

The growing use of encryption is “overwhelmingly affecting law enforcement” when companies don’t cooperate or sell equipment that can’t be penetrated by investigators, FBI Director James Comey told the Senate intelligence committee in a Feb. 9 hearing.

“It is a big problem for law enforcement armed with a search warrant when you find a device that can’t be opened, even though the judge said there’s probable cause to open it,” Comey said.

The case is significant because it shows a side of the encryption debate that is seldom discussed. Despite complaints from law enforcement and intelligence officials that encryption makes certain data off limits, agencies have workarounds for some of the most important cases.

‘Master Key’

The Justice Department wants Apple to provide customized software that will prevent the data on the phone from being deleted after 10 attempts to input the passcode. The software also must enable agents to send electronic passcodes to the phone, rather than manually typing them in, according to the application.

The software would allow agents to automatically enter multiple passcodes to get around the encryption standards. Cook likened the federal order to creating a “master key” that could be used to unlock any number of other iPhones in use around the globe.

“What’s being asked is a tool that only does this specific thing,” said Bruce Schneier, who writes about computer security. “It’s not fair. They can’t build a specific tool. Once you build this universal key, suddenly we’re all at risk.”

Apple said it has helped in the San Bernardino case, including providing data in its possession and offering ideas to investigators.

Apple’s Control

Apple has the ability to modify software that is created to only function within the subject device, prosecutors said in the application for the order. Apple controls the hardware and software that is used to turn on and run its phone, they said.

Los Angeles U.S. Attorney Eileen Decker said federal investigators have “worked tirelessly to exhaust every investigative lead” related to the terrorist attack.

“The application filed today in federal court is another step -- a potentially important step -- in the process of learning everything we possibly can about the attack in San Bernardino,” Decker said in a statement.

The case is: In the matter of the search of an Apple iPhone seized during the execution of a search warrant on a black Lexus IS300, 15-00451, U.S. District Court, Central District of California.

Before it's here, it's on the Bloomberg Terminal. LEARN MORE