Out Apple boss Tim Cook has delivered a stark warning about “dangerous” government monitoring in the US, after spy chiefs demanded a built-in security ‘backdoor’ for iPhones.

The tech CEO, who took over as head of Apple from late founder Steve Jobs, wrote an open letter to all Apple customers today – after the US government ordered the company to install a workaround.

He wrote: “The US 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.

“Specifically, the FBI wants us to make a new version of the iPhone operating system, circumventing several important security features, and install it on an iPhone recovered during the investigation [of the San Bernardino mass shooting].

“In the wrong hands, this software — which does not exist today — would have the potential to unlock any iPhone in someone’s physical possession.

“The FBI 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 backdoor.

“And while the government may argue that its use would be limited to this case, there is no way to guarantee such control.”

He explained: “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. In the physical world, it would be the equivalent of a master key, capable of opening hundreds of millions of locks — from restaurants and banks to stores and homes. No reasonable person would find that acceptable.

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

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

He added that the FBI is attempting to “use of the All Writs Act of 1789 to justify an expansion of its authority” rather than attempt to pass a motion from Congress, adding: “The implications of the government’s demands are 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.

He added: “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.

“Opposing this order is not something we take lightly. We feel we must speak up in the face of what we see as an overreach by the U.S. government.”

“We are 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.”

Since publicly coming out in 2014, Mr Cook has been a strong supporter of LGBT rights.

He explained previously: “Honestly, I value my privacy. I’m a very private person. But it became increasingly clear to me that if I said something that it could help other people.

“And I’m glad, because I think that some kid somewhere, some kid in Alabama, I think if they just for a moment stop and say ‘if it didn’t limit him, it may not limit me’.”