Citing the global “threat to data security,” Apple CEO Tim Cook on Tuesday vowed to fight a federal judge’s order mandating the tech giant to create a backdoor to help the FBI hack into the iPhone.

Judge Sheri Pym of the Federal District Court for Central California on Tuesday ordered the company to "assist in enabling the search” of the iPhone 5c that was used by Syed Rizwan Farook, one of the San Bernardino shooters killed by police.

According to the Electronic Frontier Foundation’s (EFF) analysis of the order, “For the first time, the government is requesting Apple write brand new code that eliminates key features of iPhone security — security features that protect us all.”

“Essentially, the government is asking Apple to create a master key so that it can open a single phone,” the organization warned. “And once that master key is created, we're certain that our government will ask for it again and again, for other phones, and turn this power against any software or device that has the audacity to offer strong security.”

But in a public “Message to Our Customers,” Cook rejected that argument, calling the government's move an “unprecedented step,” which he said amounts to asking the company to “hack our own users.” He wrote, “Up to this point, we have done everything that is both within our power and within the law to help them. But now the U.S. 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.”

“The F.B.I. 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 back door,” Cook wrote. “And while the government may argue that its use would be limited to this case, there is no way to guarantee such control.”

It didn't take long for almost every Republican running for president to take the side of the FBI. "I agree 100 percent with the courts. In that case, we should open it up," multi-billionaire Donald Trump told Fox and Friends on Wednesday. "I think security, overall, we have to open it up and we have to use our heads."

According to New York Times reporters Katie Benner and Eric Lichtblau, the development sets up a “legal showdown” between the company and the government. The EFF says it will file an amicus brief to support Apple.

Meanwhile, Apple and other major tech companies face fresh charges that they may be using materials extracted by children working under hazardous conditions in the Democratic Republic of Congo to manufacture their products.

Watch the CBS News report on Tim Cook’s announcement: