The US Justice Department has succeeded in unlocking an iPhone used by one of the San Bernardino shooters and has dropped its legal case against Apple.

The outcome ends a high-stakes legal battle but leaves the broader struggle over encryption unresolved.

The abrupt end to a confrontation that had transfixed the technology industry was a victory for Apple, which vehemently opposed a court order obtained by the Justice Department that would have required it to write new software to allow access to the iPhone.

"From the beginning, we objected to the FBI's demand that Apple build a back door into the iPhone because we believed it was wrong and would set a dangerous precedent," Apple said in a statement late last night.

"As a result of the government's dismissal, neither of these occurred. This case should never have been brought."

But the larger fight over law enforcement access to encrypted information is by no means over. The technology industry is adamant that anything that helps authorities bypass the security features of tech products will undermine security for everyone.

Government officials are equally insistent that all manner of criminal investigations will be crippled without access to phone data.

At issue in the case was a iPhone used by Rizwan Farook, one of the husband-and-wife shooters in the December attack in San Bernardino, California, in which 14 people were killed and 22 wounded.

The couple died in a shootout with police after the attack.

Read: 'A pyrrhic victory for Apple in FBI encryption battle'

After saying for weeks in court filings and congressional testimony that Apple possessed the "exclusive technical means "to unlock Farook's phone, the Justice Department unexpectedly announced on the eve of a court hearing last week that an unidentified outside party had presented it with a technique that might open the phone without help from Apple.

In a two-page court filing yesterday, the Justice Department said the government had "successfully accessed the data stored on Farook's iPhone and therefore no longer requires the assistance from Apple."

It asked a federal magistrate in Riverside, California, to withdraw the order compelling Apple to assist.