A judge in the United States has ruled that Apple cannot be forced to give the FBI access to a locked iPhone in a case that echoes an ongoing legal battle.
The judge in Brooklyn denied a motion by the US Justice Department to get Apple to unlock a phone in a drug case.
In an unrelated case, the FBI wants Apple to unlock the iPhone of Syed Rizwan Farook, who killed 14 people in San Bernardino, California in December.
But Apple has resisted, calling that demand "dangerous" and "unprecedented".
The ruling in Brooklyn on Monday centres on the same point as the San Bernardino case.
Analysis: Dave Lee, BBC North America technology reporter, San Francisco
The two court cases are not linked - the magistrate in San Bernardino doesn't have to pay any attention to the ruling and remarks from the New York judge.
But Apple feels the decision in New York gives added strength to its position. A senior Apple spokesman told reporters in a conference call that he was confident the San Bernardino judge would carefully analyse the New York ruling.
Most promising for Apple is the reason for which Judge Orenstein threw out the New York case.
He said he was not at all convinced the All Writs Act, a law more than two centuries old, could be used to force Apple to comply. The same law is being used in San Bernardino.
The All Writs Act is designed to give law enforcement powers not specifically addressed in other laws - but using it requires meeting certain strict criteria, too burdensome to detail here.
No legal precedent has been set here - but as the magistrate in San Bernardino considers her ruling, momentum certainly appears to be with the computing giant.
Fourteen people were killed and 22 injured when gunman Farook and his wife Tashfeen Malik opened fire in the Californian city in December.
A court order in California demanded Apple help circumvent security software on Farook's iPhone, which the FBI said contains crucial information.
The same Act from 1789 that was used by the FBI in the San Bernardino request was applied in the Brooklyn case. But Judge James Orenstein said the Act was not applicable in this case, adding that it was not right to impose "on Apple the obligation to assist the government's investigation against its will".
The US Justice Department said it planned to appeal against the Brooklyn ruling.