Marco della Cava, Jessica Guynn, and Jon Swartz

USA TODAY

SAN FRANCISCO — With Apple filing a motion Thursday to dismiss the government's request for help accessing a killer's iPhone, consider the battle now officially joined.

In one corner, U.S. law enforcement officials argue that public safety hangs in the balance if they cannot command tech companies to help with its investigations. In the other, Tim Cook and a global brand that prides itself on products that are both beautiful and secure.

Who will win? And when? Given the far-reaching ramifications of the outcome, legal experts anticipate lots of legal wrangling with neither party holding an edge.

Latest: U.S. vs. Apple over San Bernardino iPhone

“Apple says this is a matter of the Constitution, and the FBI says it is of national security,” says Larry Downes, a project director at Georgetown Business School. “There are millions of possible courses this can take. This (case) is in the earliest possible stage, and these types of things go back and forth, among courts, for months, if not years.”

Latest: U.S. vs. Apple over San Bernardino iPhone

The government's task will be to make a public case against a company with legendary marketing prowess and a powerful public fan base, said Downes.

Apple's dilemma is trying to do battle on the legal turf of the federal government in Washington, D.C., where Apple has low visibility and influence compared to its Bay Area base. Plus, it's making an anti-law enforcement case in an era of terrorist alerts and random shootings.

The Cupertino, Calif., company's Thursday motion rejecting an order that it create new software to allow the FBI to break into the iPhone 5C belonging to one of the assailants in the San Bernardino massacre was anticipated -- and supported by the tech industry at large.

Google and Facebook will be among those filing a joint amicus brief in support of Apple's position, according to two people familiar with the plans but who weren't authorized to speak publicly on the matter. Twitter confirmed it would support Apple as well. Twitter and Microsoft are among the companies that may also join that brief or write their own, said a person familiar with the discussions who was not authorized to discuss it publicly. Microsoft officials would not comment on whether it would be part of the group.

Apple said that assisting the government to crack into the phones is "in conflict with the First and Fifth Amendments of the United States Constitution," referring to free speech and the right to avoid self-incrimination.

Also, complying with the government order would force it to create "a new 'GovtOS,'" in other words, an operating system that has a route around its current operating system's encryption, as well as a FBI forensics lab on site, Apple said in a statement to reporters.

Justice Department spokeswoman Melanie Newman said Thursday that its attorneys "are reviewing Apple’s filing and will respond appropriately in court.”

Apple plans two-pronged attack in fight with FBI

As Apple filed its response in a California federal court, FBI Director James Comey told a House panel that he did not “fully understand’’ Apple’s opposition in the San Bernardino case.

“This is a single phone in a very important investigation,’’ Comey said, adding that the government request was narrowly tailored and did not threaten the privacy of other Apple customers. “I’m a big fan of privacy; I love encryption…But if we get to a place in American life where certain things are immune from a judge’s order, then we are in a very different world.’’

Comey said federal investigators were obligated to pursue every lead in the San Bernardino case to determine if others, perhaps unknown to authorities, may have been involved and to account for every moment of the terrorist’s activities before and after the December attack. Authorities still have been unable to fully account for 19 minutes of the terrorists’ movements following the deadly mass shooting and before they killed in a shootout with law enforcement.

“We ought to be fired in the FBI, if we didn’t pursue that lead,’’ he said.

APPLE RISKS 'BLOOD ON THEIR HANDS'

Several lawmakers encouraged Comey to continue his pursuit of Apple’s cooperation, including Rep. David Jolly, R-Fla., who thanked the FBI director during his appearance before the House Appropriations Committee.

“Apple’s leadership,’’ the congressman said, “risks having blood on their hands.’’

Apple's motion to vacate boils down to three arguments, according Apple. The first hinges on the fact that "no court has ever granted the government power to force companies like Apple to weaken its security systems," which also would have the added financial impact of potentially harming the company's reputation with consumers.

FBI not trying to send message or set precedent with Apple case, Comey says

“The government wants Apple to build in flaws with a backdoor,” says Harvey Anderson, chief legal officer at computer-security company AVG Technologies. “It’s like asking an automaker to design a less-safe car. This undercuts Apple’s relationship with its customers, who value the security of its products.”

Anderson adds that while the government ultimately "may win this (case), the tech industry will work even harder to build stronger products that are not vulnerable to backdoors.”

According to reports, Apple is in fact working on new encryption technology that would make it impossible for anyone - including its own engineers - to access data in a mobile device.

The second point amounts to a rejection of the All Writs Act, which in the past has allowed the government to get assistance in accessing technological devices used in criminal activities. Apple's statement notes that "the question whether companies like Apple should be compelled to create a backdoor to their own operating systems to assist law enforcement is a political question, not a legal one."

Apple CEO Tim Cook has said that the issue at large should be taken up by Congress.

CODE IS SPEECH

“Code itself is considered speech,” says Mark Bartholomew, a professor of cyberlaw and privacy law at University of Buffalo. “But the line between speech and conduct is fuzzy under First Amendment law. “Apple’s stronger strategy is that the government’s request is unwarranted under the All Writs Act.”

And the last point contends simply that "the government's demands violates Apple's constitutional rights." Specifically, Apple wrote computer code to protect data on its products due to its views about consumer privacy. "By forcing Apple to write software that would undermine those values ... (it forces) Apple to express the government's viewpoint on security and privacy instead of its own."

Public opinion remains divided on the Apple vs. FBI case, with some siding with the government's need to battle terrorism while others remain concerned about officials eavesdropping on citizens.

At the moment, Apple has the support of a range of organizations and tech companies.

Microsoft president Brad Smith announced Thursday that his company also would be filing a friend of the court opinion. Similar briefs will also be filed by the American Civil Liberties Union, the Electronic Frontier Foundation and Amnesty International.

Contributing: Kevin Johnson in Washington, D.C.

Follow USA TODAY tech reporters Marco della Cava, Jessica Guynn and Jon Swartz on Twitter.