A federal judge in New York on Monday ruled in favor of Apple, saying that an obscure colonial-era law did not authorize him to force the firm to lift data from an iPhone at the government’s request.

The ruling is not binding in any other court, but takes on an outsize importance as the U.S. government battles Apple in a separate case in California over whether the tech firm should help unlock a phone used by one of the shooters in the San Bernardino terrorist attack last December.

The two cases involve different versions of iPhone’s operating system and vastly different requests for technical help, but they both turn on whether a law from 1789 known as the All Writs Act can be applied to cases in which the government cannot get at encrypt ed data stored on suspects’ devices.

Magistrate Judge James Orenstein in Brooklyn, who sits in the Eastern District of New York, has become the first federal judge to rule that the act does not permit a court to order companies to pull encrypted data off a customer’s phone or tablet. Orenstein made the ruling, having noted that Apple has extracted data in similar federal cases at least 70 times before.

Orenstein found that the All Writs Act does not apply in instances where Congress had the opportunity but failed to create an authority for the government to get the type of help it was seeking, such as having firms ensure they have a way to obtain data from encrypted phones.

He also found that ordering Apple to help the government by extracting data from the iPhone- which belonged to a drug dealer –would place an unreasonable burden on the company.

“We are disappointed in the Magistrate’s ruling and plan to ask the District Judge to review the matter in the coming days,” a Justice Department spokewoman Emily Pierce said in a statement. “As our prior court filings make clear, 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. 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.”

Nonetheless, Orenstein’s ruling, said Alex Abdo, staff attorney with the American Civil Liberties Union, “sends a strong message that the government can’t circumvent the national debate by trying to manufacture new authorities through the courts.”

Following Orenstein’s reasoning, Abdo said, “If the court rejects the government’s request in New York, then the FBI’s request in San Bernardino is necessarily illegal, too.”

But other analysts say that other courts are just as likely to rule in the opposite direction. In Riverside, Calif., for instance, magistrate judge Sheri Pym, at the Justice Department’s request, last week issued an order requiring Apple to build software to override a safety feature in a different iPhone operating system to enable the FBI to try its hand at cracking the phone’s password.

The order was unprecedented. The government has never before asked a firm to build software to undo a security feature that it had built in to protect a phone’s encrypted data. In this case, the feature wipes data from the phone after 10 incorrect tries to guess the password. But FBI Director James Comey said the request was “quite narrow” and meant only to allow the bureau to try to guess “the terrorist’s passcode without the phone essentially self-destructing.”

Experts said that once the feature was overridden, it should take about 20 to 30 minutes to crack a four-digit password. Apple fears that if it is forced to comply with that request, countless more will follow to help it unlock phones in even routine criminal investigations.