(Reuters) - Apple Inc on Thursday struck back in court against a U.S. government demand that it unlock an encrypted iPhone belonging to one of the San Bernardino shooters, arguing such a move would violate its free speech rights and override the will of Congress.

An Apple logo hangs above the entrance to the Apple store on 5th Avenue in the Manhattan borough of New York City, July 21, 2015. REUTERS/Mike Segar

The high-stakes fight between Apple and the government burst into the open last week when the U.S. Federal Bureau of Investigation obtained a court order requiring Apple to write new software and take other measures to disable passcode protection and allow access to shooter Rizwan Farook’s iPhone.

The clash has driven to the heart of a long-running debate over how much law enforcement and intelligence officials should be able to monitor digital communications.

Arguing that the court should throw out the order that it issued last week, Apple said in its brief on Thursday that software was a form of protected speech, and thus the Justice Department’s demand violated the constitution.

“The government’s request here creates an unprecedented burden on Apple and violates Apple’s First Amendment rights against compelled speech,” it said.

Apple also contended that the court was over-stepping its jurisdiction, noting that Congress had rejected legislation that would have required companies to do the things the government is asking Apple to do in this case.

“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 said in its filing.

The government argues that the All Writs Act, a broad 1789 law which enables judges to require actions necessary to enforce their own orders, compels Apple to comply with its request.

But Apple argued in its filing that prosecutors wrongly applied a key U.S. Supreme Court case, which involved a telephone company, to the San Bernardino situation. Since Apple is not a utility, and because Congress declined to force companies like Apple to build “backdoors” into their products, Apple said it should not be forced to help the government hack into the San Bernardino iPhone.

The Justice Department won the order from the federal court in Riverside, California last week, without the company present. The judge allowed Apple to respond in the brief on Thursday, and a hearing is scheduled for next month.

Some of the largest tech companies appear to be lining up behind Apple. Google and Facebook will both file briefs supporting the iPhone maker, said several sources familiar with the matter who were not authorized to speak publicly about it. Microsoft will file a friend-of the-court brief as well, company President Brad Smith said in congressional testimony Thursday. Twitter also said it will sign a brief in support of Apple.

In a statement responding to Apple’s filing, the Justice Department said its approach to prosecuting crimes has not changed.

“The change has come in Apple’s recent decision to reverse its long-standing cooperation in complying with All Writs Act orders,” department spokesperson Melanie Newman said.

While much of Apple’s argument is that the All Writs Act does not apply, the free speech and due process claims could prove helpful if the company wants to attract the attention of the Supreme Court, said Jill Bronfman, director of the Privacy and Technology Project at University of California Hastings College of the Law.

“It always does help to mention the Constitution,” she said.

If the San Bernardino order is upheld, Apple said, it could leave individuals and business vulnerable to an unlimited array of government directives.

“Under the same legal theories advocated by the government here, the government could argue that it should be permitted to force citizens to do all manner of things ‘necessary’ to assist it in enforcing the laws,” Apple said. It gave examples, “like compelling a pharmaceutical company against its will to produce drugs needed to carry out a lethal injection in furtherance of a lawfully issued death warrant or requiring a journalist to plant a false story in order to help lure out a fugitive.”

Apple also laid out the resources it believes would be necessary to comply with the government’s request, saying it would likely require a team of up to 10 Apple engineers and employees for as long as four weeks.

Complying with the request would also likely lead to “hundreds” of more demands from law enforcement, Apple said.

“Responding to these demands would effectively require Apple to create full-time positions in a new ‘hacking’ department to service government requests,” the company said in the filing.

Earlier on Thursday, FBI Director James Comey told a congressional panel that court approval of the FBI’s request was “unlikely to be a trailblazer” in other cases.

While the case “will be instructive for other courts,” larger policy questions about reasonable law enforcement access to encrypted data will likely need to be resolved by Congress and others, Comey said.

Shares of Apple were barely changed and closed up less than 1 percent at $96.76.

Apple also raised the spectre of courts ordering it to help in other cases in other ways, such as writing computer code that would turn on an iPhone microphone to help surveillance.

The company also criticized the Justice Department for publicizing the order, which would normally have been filed under seal.

“This is the only case in counsel’s memory in which an FBI Director has blogged in real-time about pending litigation, suggesting that the government does not believe the data on the phone will yield critical evidence about other suspects,” the company said.

Apple CEO Tim Cook said in an interview on Wednesday with ABC News that the company was prepared to take the case to the Supreme Court if necessary.