(Reuters) - Apple Inc AAPL.O Chief Executive Tim Cook said his company opposed a demand from a U.S. judge to help the FBI break into an iPhone recovered from one of the San Bernardino shooters.

Cook said that the demand threatened the security of Apple's customers and had "implications far beyond the legal case at hand." (apple.co/1Lt7ReW)

Judge Sheri Pym of U.S. District Court in Los Angeles said on Tuesday that Apple must provide “reasonable technical assistance” to investigators seeking to unlock data on an iPhone 5C that had been owned by Syed Rizwan Farook.

In a letter to Apple’s customers, Cook said the FBI had asked the company to build “a backdoor to the iPhone.”

“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,” he said.

“We can find no precedent for an American company being forced to expose its customers to a greater risk of attack.”

(Corrects dateline to Feb 17 from Feb 16)