(CNN) Apple is opposing a judge's order to help the FBI break into the iPhone of one of the San Bernardino, California, shooters, calling the directive "an overreach by the U.S. government."

"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," the letter said.

Such a move would be an "unprecedented step," threatening the security of Apple's customers, it said.

"No reasonable person would find that acceptable."

The letter called for a public discussion on the order, saying the company was "challenging the FBI's demands with the deepest respect for American democracy and a love of our country."

"We believe it would be in the best interest of everyone to step back and consider the implications," the letter said.

Passcode thwarts investigators

A judge in California ordered Apple on Tuesday to help the FBI break into the phone of San Bernardino shooter Syed Farook.

Photos: San Bernardino shooting Photos: San Bernardino shooting Police officers stand guard as they investigate a suspicious vehicle in Redlands, California, on Wednesday, December 2, after a mass shooting in nearby San Bernardino in which 14 people died and 21 were injured. The shooting took place at the Inland Regional Center, where employees with the county health department were attending a holiday event. The two shooters -- Syed Rizwan Farook and his wife, Tashfeen Malik -- were fatally shot in a gun battle with police hours after the initial incident. Farook worked for the county health department. Hide Caption 1 of 29 Photos: San Bernardino shooting A police officer places a marker along East San Bernardino Avenue, near where the shootout occurred. Hide Caption 2 of 29 Photos: San Bernardino shooting Law enforcement officers search a residential area for suspects who fled after the shooting. Hide Caption 3 of 29 Photos: San Bernardino shooting Police search for the suspects in San Bernardino. Hide Caption 4 of 29 Photos: San Bernardino shooting The residential area was not far from where the shooting occurred. Hide Caption 5 of 29 Photos: San Bernardino shooting Law enforcement officers search a neighborhood in San Bernardino. Hide Caption 6 of 29 Photos: San Bernardino shooting A police officer loads his weapon while pursuing suspects. Hide Caption 7 of 29 Photos: San Bernardino shooting A SWAT team mobilizes during the search. Hide Caption 8 of 29 Photos: San Bernardino shooting People pray on the San Bernardino Golf Course, across the street from where the shooting took place. Hide Caption 9 of 29 Photos: San Bernardino shooting Heavily armed law enforcement officers swarmed the area where the shooting occurred. Hide Caption 10 of 29 Photos: San Bernardino shooting People leave a community center after reuniting with friends and family in the aftermath of the shootings. Hide Caption 11 of 29 Photos: San Bernardino shooting A woman is comforted near the scene of the shooting. Hide Caption 12 of 29 Photos: San Bernardino shooting A police helicopter hovers around the Inland Regional Center. Hide Caption 13 of 29 Photos: San Bernardino shooting Luis Gutierrez gets emotional as he talks about his wife who works in the facility and saw a gunman, according to Los Angeles Times photographer Marcus Yam. Hide Caption 14 of 29 Photos: San Bernardino shooting Two women speak with a firefighter at a triage area near the scene. Hide Caption 15 of 29 Photos: San Bernardino shooting Police stand guard outside of the emergency room at the Loma Linda University Medical Center, where some of the victims were being treated. Hide Caption 16 of 29 Photos: San Bernardino shooting Police escort civilians away from the site of the shooting. Hide Caption 17 of 29 Photos: San Bernardino shooting People walk away from the scene. It is unclear how many people were at the facility at the time of the shooting. Hide Caption 18 of 29 Photos: San Bernardino shooting Police in SWAT gear secure the area. Hide Caption 19 of 29 Photos: San Bernardino shooting Two women embrace at a community center where family members were gathering to pick up people from the scene. Hide Caption 20 of 29 Photos: San Bernardino shooting People gather at the San Bernardino Golf Course. Hide Caption 21 of 29 Photos: San Bernardino shooting People talk to police at the golf course. Hide Caption 22 of 29 Photos: San Bernardino shooting A woman is wheeled away on a stretcher. Hide Caption 23 of 29 Photos: San Bernardino shooting People are moved away from the area by bus. Hide Caption 24 of 29 Photos: San Bernardino shooting Police and fire personnel are seen near the site of the shooting. Hide Caption 25 of 29 Photos: San Bernardino shooting A crowd gathers behind the police line. Hide Caption 26 of 29 Photos: San Bernardino shooting Ambulances pull out of a staging area near the Inland Regional Center. Hide Caption 27 of 29 Photos: San Bernardino shooting A SWAT vehicle carries police officers. Hide Caption 28 of 29 Photos: San Bernardino shooting SWAT teams and a bomb squad were working to clear the buildings where the shootings took place. Hide Caption 29 of 29

Investigators had obtained permission to retrieve data from the phone but had been unable to search the device as it had been locked with a user-generated numeric passcode.

Apple's operating systems included an auto-erase function that, when enabled, would result in the information on the phone being permanently wiped after 10 failed attempts at inputting the passcode, the government wrote in documents seeking the order.

"We have made a solemn commitment to the victims and their families that we will leave no stone unturned as we gather as much information and evidence as possible. These victims and families deserve nothing less," Eileen Decker, U.S. attorney for the Central District of California, said in a statement in response to the court order.

"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."

The point was echoed Wednesday in a Justice Department statement that stressed, from its perspective, what the judge's order does and does not do.

"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," it read.

"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. In addition, the judge's order and our request were narrowly tailored to this particular phone," the statement said.

iPhone 'backdoor'

Apple said the FBI had requested that the tech giant produce a new version of the iPhone operating system that circumvented key security features to install on Farook's phone.

"In the wrong hands, this software -- which does not exist today -- would have the potential to unlock any iPhone in someone's physical possession," Cook's letter said.

JUST WATCHED Sergeant opens up about terror attack Replay More Videos ... MUST WATCH Sergeant opens up about terror attack 02:19

The FBI did not describe such a move as a "backdoor" into the iPhone, but complying with the request would "undeniably" create one, and limiting its use to the Farook case could not be guaranteed, the letter said.

"The government suggests this tool could only be used once, on one phone. But that's simply not true. Once created, the technique could be used over and over again, on any number of devices," it said.

"The same engineers who built strong encryption into the iPhone to protect our users would, ironically, be ordered to weaken those protections and make our users less safe," the letter continued, adding it could find "no precedent for an American company being forced to expose its customers to a greater risk of attack."

Apple: Implications 'chilling'

Apple, which has helped the FBI with similar requests in the past, said in the letter that it had "great respect for the professionals at the FBI, and we believe their intentions are good."

"We have no sympathy for terrorists," it said, adding it did not oppose the order lightly.

But it said the FBI was proposing "an unprecedented use" of law dating from 1789 to justify an expansion of its authority, the implications of which were "chilling."

"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," it said.

"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."

Republican presidential candidate Donald Trump gave his take on the standoff Wednesday, saying Apple should comply with the judge's order.

"I agree 100% with the courts," Trump said on "Fox and Friends."

"I think security over all -- we have to open it up, and we have to use our heads."