Apple on Thursday urged a federal court to toss out an order that the company help the FBI hack into an iPhone used by a shooter in the San Bernardino attack, arguing that it was a "dangerous power."
The legal response was fired in what promised to be a landmark case pitting national security against personal privacy.
"Last week's judicial order may have prompted among the most high-profile battles we have seen over device encryption," Internet rights group Electronic Frontier Foundation said on its website.
"But this is not the first time, nor is it likely to be the last time, we are called to defend access to tools that can ensure privacy and security."
Apple chief Tim Cook has called for the stand-off to be resolved by legislation in US Congress, not in the courts.
Cook equated what the FBI was demanding as a software version of "cancer."
Apple said in a court filing that the government overstepped its legal authority in trying to force the company to facilitate access to a locked iPhone used by one of the shooters the San Bernardino attack last year, which left 14 dead.
"No court has ever authorized what the government now seeks, no law supports such unlimited and sweeping use of the judicial process, and the constitution forbids it," Apple's lawyers wrote in the motion filed in California federal court.
The Apple response is the latest in the fight over how far the company must go in helping US law enforcement access a device with data locked by encryption that only the user can normally access.
"The government demands that Apple create a back door to defeat the encryption on the iPhone, making its users' most confidential and personal information vulnerable to hackers, identity thieves, hostile foreign agents and unwarranted government surveillance," Apple's brief said.
Apple executives, who briefed reporters on condition they not be quoted directly, said the order would effectively require the creation of a "government operating system" which could be used repeatedly by FBI forensics experts and potentially leak out to others.
The iPhone maker is arguing that the government effort violates Apple's constitutional rights to free speech, by forcing it to write software that undermines its values.
Apple's brief also said the legal showdown came despite a pledge by government officials not to seek legislation for easier access to encrypted devices.
"This case is about the Department of Justice and the FBI seeking through the courts a dangerous power that Congress and the American people have withheld: the ability to force companies like Apple to undermine the basic security and privacy interests of hundreds of millions of individuals around the globe," Apple said in the filing.
Apple's tech rivals closed ranks, with Microsoft and Google announcing they would file briefs in court supporting the iPhone maker. Facebook meanwhile endorsed a collective letter supporting Apple.
Microsoft Vice President Brad Smith, appearing in Congress on Thursday, said, "We do not believe that courts should seek to resolve issues of 21st-century technology with law that was written in the era of the adding machine."
The Apple filing comes one week after the US Justice Department filed a motion to compel Apple to provide "reasonable technical assistance" sought by the FBI. The government filing, in sharp contrast to that of Apple, said the order would not require a "back door to every iPhone."
The Justice Department said Apple's public statements suggest it is basing its defense on "marketing concerns" and that the company was not being asked to hand over any sensitive software that could be used by hackers.
Earlier Thursday, FBI Director James Comey reiterated his position at a hearing on Capitol Hill.
"The San Bernardino litigation is not about us trying to send a message or establish some kind of precedent," Comey told lawmakers at the House Intelligence Committee.
"It's about trying to be competent in investigating something that is an active investigation."
The phone at the center of the standoff belonged to Syed Farook, a US citizen, who carried out the attack on an office party in San Bernardino along with his Pakistani wife Tashfeen Malik. The attack left 14 dead.
Lawmakers eye 'solution'
Separately, US lawmakers moved to break the deadlock that has divided the public by calling a hearing with the FBI and Apple in an effort to craft "a solution."
The hearing called by the House Judiciary Committee for next Tuesday will be the first in Congress since Apple said it would challenge the court order.
A statement said scheduled witnesses include FBI chief Comey and Bruce Sewell, Apple's senior vice president and general counsel.
Also scheduled to appear are Susan Landau, a cybersecurity expert at Worcester Polytechnic Institute and Cyrus Vance Jr., the New York district attorney who has criticized Apple for locking its iPhones without allowing law enforcement access.