Zeid Ra'ad Al Hussein, high commissioner for human rights at the United Nations, has warned that a "Pandora's box" will be opened if Apple co-operates with the FBI.

The FBI has ordered the tech giant to assist it with unlocking an iPhone used by San Bernadino gunman Syed Farook.

Prince Al Hussein said the law enforcement agency "deserves everyone's full support" in its investigation.

However, encryption was essential in the interests of freedom, he added.

"There are many ways to investigate whether or not these killers had accomplices besides forcing Apple to create software to undermine the security features of their own phones," he said in a statement.

"It is potentially a gift to authoritarian regimes, as well as to criminal hackers.

"Encryption and anonymity are needed as enablers of both freedom of expression and opinion, and the right to privacy. Without encryption tools, lives may be endangered."

Syed Rizwan Farook and his wife Tashfeen Malik killed 14 people and left 22 injured when they opened fire at his place of work in California in December 2015.

The FBI has asked Apple to disable a feature that means the data on an iPhone is erased after 10 incorrect attempts at the four-digit password. It also wants to be able to run software that could go through the 10,000 possible combinations to unlock the gunman's handset quickly.