A US federal judge in Massachusetts has ordered Apple to help the FBI unlock an iPhone in a gang case, court documents unsealed Friday revealed -- opening a new front in the government's battle with the high-tech giant over encryption.

The Justice Department is also pressing Apple to help crack a phone in a New York drug case, in more evidence that the showdown is far from over, despite the abrupt end to another challenge linked to the San Bernardino mass shooting.

In the San Bernardino case, the government dropped legal action against Apple when it announced investigators had extracted data from the iPhone of a gunman with the help of an unnamed "outside party."

But key questions remain about how much access law enforcement should have to encrypted devices and how to balance security issues with user privacy rights -- questions that could be answered by the pending cases.

A judge in Boston in February ordered Apple to help police extract data from an iPhone confiscated last year from an alleged gang member, according to documents posted online Friday by the American Civil Liberties Union.

Apple told AFP it had challenged the order on legal grounds, and told the court it could not unlock the handset because it was powered by iOS 9 software with updated security features.

In the New York case, Justice Department lawyers told US District Court Judge Margo Brodie in a written filing: "The government continues to require Apple's assistance in accessing the data that it is authorized to search by warrant."

Apple lawyers said they were disappointed by what amounted to an appeal by the government, arguing anew that it was an attempt to set a troubling legal precedent and not really a pursuit of vital information for fighting crime.

In the New York case, the accused drug trafficker confessed and is set to be sentenced, according to Apple attorneys. Apple is being asked to extract data from an iPhone and provide it for purposes of sentencing.

Story continues

In contrast, in the San Bernardino case, the government called on Apple to create a new tool to bypass iPhone security systems to crack into an iPhone used by one of the shooters in a December rampage that left 14 dead.

- Apple holds its ground -

Apple attorneys said they planned to oppose the government's effort in the New York case by pressing in court to find out whether it has done everything possible without the company's help to get the data it seeks and by continuing to argue the request is not backed by the law.

The US Drug Enforcement Agency and the FBI went to court in New York to compel Apple to help it break into an iPhone confiscated in June 2014 from a suspected methamphetamine trafficker, according to court documents.

The US government sought to get Apple to help break into the iPhone under the auspices of the All Writs Act -- a 1789 law that gives wide latitude to law enforcement, and the same one cited in the San Bernardino case.

Earlier this year, a lower court judge in New York sided with Apple, saying law enforcement lacked the authority to compel the company to comply.

"The relief the government seeks is unavailable because Congress has considered legislation that would achieve the same result but has not adopted it," US Magistrate Judge James Orenstein wrote.

Apple on Friday maintained its position that the government was over-reaching its authority, and that the degree to which third parties can be compelled to work for the government was something that should be decided by elected lawmakers.

Congress is indeed expected to consider legislation which would require technology firms to retain "keys" that could retrieve data in a criminal investigation with a court order.

A broad coalition of technology companies and activists have argued against any encryption rules that would allow "special access" for law enforcement, claiming these would be vulnerabilities that could be exploited by hackers or repressive governments, and threaten security of banking, electronic commerce, trade secrets and more.