The ruling, from Judge James Orenstein in New York’s Eastern District, is the first time that the government’s legal argument for opening up devices like the iPhone has been put to the test. The denial could influence other cases where law enforcement officials are trying to compel Apple to help unlock iPhones, including the standoff between Apple and the F.B.I. over the iPhone used by one of the attackers in a mass shooting in San Bernardino, Calif., last year.
Judge Orenstein, in his 50-page ruling on Monday, took particular aim at a 1789 statute called the All Writs Act that underlies many government requests for extracting data from tech companies. The All Writs Act broadly says that courts can require actions to comply with their orders when not covered by existing law. Judge Orenstein said the government was inflating its authority by using the All Writs Act to force Apple to extract data from an iPhone seized in connection with a drug case.
The government’s view of the All Writs Act is so expansive as to cast doubt on its constitutionality if adopted, Judge Orenstein wrote.
The All Writs Act is also being invoked in the fight over an iPhone in the San Bernardino shooting, which has publicly pitted Apple against the government. Apple’s chief executive, Timothy D. Cook, has refused to comply with a federal court order to help break into the phone, saying that he needs to protect the data of all customers. That has set off a far-reaching debate over privacy and security.
Both the F.B.I. and Apple have called for Congress to step in to help settle the question of when law enforcement should get access to citizens’ private data. On Tuesday, Apple’s general counsel, Bruce Sewell, and James B. Comey, the F.B.I. director, will testify about balancing privacy and safety before the House Judiciary Committee.
“It’s important that a judge for the first time recognizes the All Writs Act doesn’t provide the lawful authority the government has been claiming in these cases,” said Esha Bhandari, a lawyer with the A.C.L.U., which supports Apple’s position. “It demonstrates that when the government’s arguments are put to the test, a federal court has decided they were not actually right.”
In a statement on Monday in response to Judge Orenstein’s ruling, the Justice Department said it would ask the judge to review the decision. Apple had previously agreed to help open up the iPhone in the drug case, and has complied with past All Writs Act orders, the Justice Department 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,” the Justice Department said.
An Apple senior executive said Monday’s ruling makes clear that helping to open an iPhone is a constitutional issue that should be taken up by Congress.
Judge Orenstein’s ruling stands out because the courts have largely been absent on the major questions of electronic surveillance and privacy of our day. While judges around the country have signed at least 70 orders at the request of the government compelling Apple to access data on phones, this was the first time that a judge and Apple have pushed back.
The legal back and forth between Judge Orenstein, the Justice Department and Apple began last October, when federal prosecutors applied for a court order to force Apple to unlock an iPhone 5s seized by the Drug Enforcement Administration in a 2014 drug case, according to court documents.
After federal prosecutors requested the order, Judge Orenstein argued in an 11-page memo last October that prosecutors were misusing the All Writs Act. The judge asked Apple to weigh in, and the company filed a brief that same month. In addition to agreeing with the judge, the company also said the request could create an undue burden and threatened to “substantially tarnish the Apple brand.”
“This reputational harm could have a longer-term economic impact beyond the mere cost of performing the single extraction at issue,” Apple said in a brief.
The government then called Apple’s decision to side with the judge a “stunning reversal.” Saritha Komatireddy, a Brooklyn federal prosecutor, said the government’s application in this case “was just a simple routine request for assistance in carrying out a valid search warrant issued by a federal court, as Apple has done so many times before.”
During the case, Judge Orenstein said he found it puzzling that Apple had not previously resisted the use of the All Writs Act, including in other cases where Apple had complied with the order.
“You have had apparently 70 prior instances where you have not taken the steps available to you,” Judge Orenstein said to Apple’s lawyers during a hearing.
Ultimately, Judge Orenstein argued that the government couldn’t use the All Writs Act to ask Apple to help extract information from a device just because a different law, the Communications Assistance for Law Enforcement Act, or Calea, addresses the issue and does not include an “information services” company like Apple. Congress has been debating whether to amend Calea to include tech companies such as Apple, Facebook and Alphabet’s Google.
Still, the decision is not binding for the San Bernardino case, said Eric A. Berg, a litigation lawyer and special counsel with Foley & Lardner, who is a former Justice Department lawyer.
“From a technical, legal standpoint, it doesn’t really have much of an effect in the California districts,” Mr. Berg said. But “if you start with public opinion, this is going to be viewed as a victory for the privacy lobby and a defeat for the government in that battle over privacy.”