In a strongly-worded letter to customers, Apple CEO Tim Cook rejected a federal court order to help the FBI unlock an iPhone used by one of the perpetrators of last December’s deadly shooting rampage in San Bernardino, California.

Reuters reports US District Judge Sheri Pym ordered Apple on Tuesday to provide “reasonable technical assistance” to the FBI, which is seeking to unlock security software on the iPhone 5c used by Syed Rizwan Farook, who along with his wife Tashfeen Malik killed 14 people and wounded 22 others at a San Bernardino County Department of Public Health training event and holiday party on December 2, 2015.

“The United States government has demanded that Apple take an unprecedented step which threatens the security of our customers,” Cook’s letter opened. “We oppose this order, which has implications far beyond the legal case at hand.”

“[The] government has asked us for something we simply do not have, and something we consider too dangerous to create. They have asked us to build a backdoor to the iPhone,” Cook continued. “Specifically, 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. In the wrong hands, this software—which does not exist today—would have the potential to unlock any iPhone in someone’s physical possession.”

“The FBI may use different words to describe this tool, but make no mistake: Building a version of iOS that bypasses security in this way would undeniably create a backdoor,” Cook asserted. “And while the government may argue that its use would be limited to this case, there is no way to guarantee such control.”

“The government is asking Apple to hack our own users and undermine decades of security advancements that protect our customers—including tens of millions of American citizens—from sophisticated hackers and cybercriminals,” Cook wrote. “We can find no precedent for an American company being forced to expose its customers to a greater risk of attack.”

“Rather than asking for legislative action through Congress, the FBI is proposing an unprecedented use of the All Writs Act of 1789 to justify an expansion of its authority,” Cook continued. “The government would have us remove security features and add new capabilities to the operating system, allowing a passcode to be input electronically. This would make it easier to unlock an iPhone by ‘brute force,’ trying thousands or millions of combinations with the speed of a modern computer.”

“The implications of the government’s demands are chilling,” Cook added. “If the government can use the All Writs Act to make it easier to unlock your iPhone, it would have the power to reach into anyone’s device to capture their data. The government could extend this breach of privacy and 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.”

“We are challenging the FBI’s demands with the deepest respect for American democracy and a love of our country,” Cook concluded. “We believe it would be in the best interest of everyone to step back and consider the implications. 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. And ultimately, we fear that this demand would undermine the very freedoms and liberty our government is meant to protect.”

Judge Pym did not order Apple to disable encryption but rather to make it easier for FBI agents to randomly guess the iPhone’s passcode. Such phones are equipped with a security feature that slows them down whenever someone tries to access them by rapidly entering random passcodes. Apple says it would take someone five and a half years to enter every possible passcode combination for one phone.

Pym’s order compels Apple to help defeat the delay.

“[Apple] will ensure that when the FBI submits passcodes to the subject device, software running on the device will not purposefully introduce any additional delay between passcode attempts beyond what is incurred Apple hardware,” it states. The order also demands that Apple disable any “auto erase” functions installed on Farook’s phone.

Tech industry leaders voiced support for Apple’s decision.

“We know that law enforcement and intelligence agencies face significant challenges in protecting the public against crime and terrorism,” Google CEO Sundar Pichai said on Twitter. “We build secure products to keep your information safe and we give law enforcement access to data based on valid legal orders. But that’s wholly different than requiring companies to enable hacking of customer devices & data. Could be a troubling precedent.”

Digital rights advocates also expressed their support for Apple’s resistance.

“The FBI is creating a world where citizens rely on Apple to defend their rights, rather than the other way around,” tweeted former NSA whistleblower Edward Snowden, who called Apple’s standoff with the government “the most important tech case in a decade.”

“EFF applauds Apple for standing up for real security and the rights of its customers,” the San Francisco-based Electronic Frontier Foundation said in a statement on its website. “We have been fighting to protect encryption, and stop backdoors, for over 20 years. That’s why EFF plans to file an amicus brief in support of Apple’s position.”

“The US government wants us to trust that it won’t misuse this power,” added EFF. “But we can all imagine the myriad ways this new authority could be abused. Even if you trust the US government, once this master key is created, governments around the world will surely demand that Apple undermine the security of their citizens as well.”

When asked to comment on Apple’s defiance, the US Department of Justice pointed the New York Times to a statement by Eileen M. Decker, the United States attorney for the Central District of California, who promised a “solemn commitment to the victims and their families” to “leave no stone unturned” in the pursuit of justice.