A federal judge in New York ruled in favor of Apple on Monday, 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 it 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 in 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 encrypted 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.

In a 50-page opinion disdainful of the government’s arguments, 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.

On Feb. 25, Apple filed a motion opposing a court order to help the FBI unlock the iPhone belonging to a San Bernardino shooter. Here's everything you need to know about Apple vs. the FBI. (Jhaan Elker/The Washington Post)

He wrote that the government’s interpretation of the 200-year-old law was “absurd” in that it would authorize what they were seeking even if every member of Congress had voted against granting such authority. It would, he added, undermine “the more general protection against tyranny that the Founders believed required the careful separation of governmental powers.”

[Read the magistrate’s order in favor of Apple]

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.

None of the factors he reviewed in the case, Orenstein said, “justifies imposing on Apple the obligation to assist the government’s investigation against its will.”

A Justice Department spokeswoman said the department was disappointed in the ruling and would appeal. “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,” spokeswoman Emily Pierce said in a statement. “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.”

Alex Abdo, staff attorney with the American Civil Liberties Union, said Orenstein’s ruling “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 could well rule in the opposite direction. In Riverside, Calif., Magistrate Judge Sheri Pym, at the Justice Department’s request, last month 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 government had 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. 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.

The prospect that the California ruling could go against Apple has tech firms rushing to file briefs in support of Apple by Thursday’s filing deadline.

Because of the nature of the request, the outcome of the California case is more significant than the Brooklyn case, analysts say. “It has the potential to alter the landscape permanently,” said Al Gidari, a former partner at Perkins Coie who represented tech firms and is now at Stanford University.

The Brooklyn case began last fall when Orenstein, one of a handful of magistrates across the country who are activists in the surveillance debate, received the government’s application to issue an order to Apple.

What seemed like a routine request — after all, this was a phone using an operating system, iOS7, that Apple had bypassed for the federal government at least 70 times before — suddenly hit a roadblock. In an Oct. 9 ruling, Orenstein identified what he thought was a problem with the government’s argument. Though prosecutors cited a 1985 decision that found that the All Writs Act is a source of authority to issue writs “not otherwise covered by statute,” he said they failed to cite another part of the decision that found that the act does not authorize the issuance of “ad hoc writs whenever compliance with statutory procedures appears inconvenient or less appropriate.”

Thus, he said, the question was whether the government was seeking to fill a gap that Congress had failed to consider, or instead sought to have the court give it authority that Congress chose not to confer.

He noted that since at least the mid-1990s, Congress has debated how far the government may go to require companies to help it with surveillance and wiretap capabilities. In fact, a 1994 law, the Communications Assistance to Law Enforcement Act, was a compromise that applied only to phone companies and later to broadband carriers, but it expressly carved out Internet companies.

And he noted that last year, lawmakers introduced bills that precluded the government from forcing companies such as Apple from building in ways to circumvent encryption on devices. The Obama administration last fall decided it would hold off on introducing such legislation.

Thus, Orenstein wrote last fall, the drug-dealer phone case “falls in the murkier area in which Congress is plainly aware” of the lack of a law that expressly authorizes the type of help the government was seeking, and had “failed” to create or reject such a law.

Apple has said that since last October, it has received federal requests to extract data in cases pertaining to at least 15 devices, some of them using the older operating systems, and some of them running on iOS8 or iOS9. The newer systems were designed in such a way that Apple could not bypass the passcode to extract data. The San Bernardino phone ran on an iOS9.