A US judge has ordered Apple to help the FBI break into a phone belonging to Syed Rizwan Farook, one of the killers in the December shooting rampage in San Bernardino, California.
US Magistrate Judge Sheri Pym of US District Court in Los Angeles ruled Apple must provide "reasonable technical assistance" to investigators seeking to unlock the data on Farook's iPhone 5C.
This includes bypassing its auto-erase function and passcode protection so investigators can try an unlimited number of passcode guesses.
Apple didn't immediately respond to a request for comment on the ruling.
The company has five business days to contest the order if it believes compliance would be "unreasonably burdensome", Pym said in her decision.
The US Attorney's Office in Los Angeles on Tuesday requested the court compel Apple to assist the investigation.
"Apple has the exclusive technical means which would assist the government in completing its search, but has declined to provide that assistance voluntarily," prosecutors said.
The case represents the latest episode in a long-running dispute between tech companies and law enforcement over encryption.
Government officials have warned that the expanded use of strong encryption is hindering national security and criminal investigations.
Technology experts and privacy advocates counter that forcing US companies to weaken their encryption for law enforcement purposes would make private data vulnerable, to hackers, undermine the security of the internet and give a competitive advantage to companies in other countries.
The December 2 attack by Farook and his wife killed 14 people and injured 22 others. The couple was killed in a shootout with police.