A federal judge in Brooklyn says the FBI cannot force Apple to open a locked iPhone used by a suspected drug dealer.
The ruling is a boost to Apple in the public opinion war with the federal government over access to locked devices. Though it is not binding on a judge in California who is now considering the separate case of access to a locked iPhone used by one of the San Bernardino attackers, it gives the company a leg up, and Apple will be sure to cite it in that ongoing dispute.
The massacre in San Bernardino, Calif., left 14 people dead, and investigators searching for answers.
U.S. Magistrate Judge James Orenstein said the FBI could not compel Apple to unlock the phone in the Brooklyn case, because Congress specifically considered and rejected a bill that would require companies like Apple to make the data on a locked iPhone available to law enforcement.
"It is also clear that the government has made the considered decision that it is better off securing such crypto-legislative authority from the courts," Orenstein said, "rather than taking the chance that open legislative debate might produce a result less to its liking."
Orenstein wrote that finding a balance between the competing interests of the governments investigative powers and unwarranted intrusion was a debate needs to take place sooner rather than later.
"The debate must happen today, and it must take place among legislators who are equipped to consider the technological and cultural realities of a world their predecessors could not begin to conceive," the judge wrote in the 50-page decision.
Judge Orenstein also agreed with Apple's contention that what the government wanted in the Brooklyn drug dealer case was too much of a burden on the company, another argument the company makes in the San Bernardino case.
"The assistance the government seeks here — bypassing a security measure that Apple affirmatively markets to its customers — is not something that Apple would normally do in the conduct of its own business and is, at least now, plainly offensive to it," Orenstein wrote.
The judge "completely sides with Apple," a senior Apple executive said in a conference call with reporters after the ruling. "It's the first case any court has had to directly and specifically address" the issues involved.
A Justice Department spokesman said the government was disappointed and will seek review of the decision.
"Apple expressly agreed to assist the government in accessing the data on this iPhone — as it had many times before in similar circumstances — and only changed course when the government's application for assistance was made public by the court," the spokesman said. "This phone may contain evidence that will assist us in an active criminal investigation and we will continue to use the judicial system in our attempt to obtain it."
Orenstein's ruling was expected, however, because he raised similar concerns in a preliminary discussion of the case issued last October.
At the time, Orenstein invited Apple to challenge the government's use of a 1789 law to compel Apple to help it recover iPhone data in criminal cases. Since then, lawyers say Apple has opposed the requests to help extract information from over a dozen iPhones in California, Illinois, Massachusetts and New York.
Monday's ruling comes a day before FBI Director James Comey and Apple's General Counsel, Bruce Sewell, appear before a congressional hearing.
This article originally appeared on NBCNews.com.