A federal judge in New York ruled Monday that the government can’t use a 227-year-old law to compel Apple to unlock an iPhone that may contain information useful to a criminal investigation.

The 1789 law, the All Writs Act, is also the cornerstone of the government’s argument in a related case in San Bernardino, California, where the FBI and Apple have faced off in an uncharacteristically public manner.

The Monday decision came from James Orenstein, a magistrate judge in Brooklyn, who had previously expressed doubt that the All Writs Act sanctions the government’s request of Apple.  

In his opinion, Orenstein pointed to two reasons why he rejected the government’s reasoning. Orenstein said that Congress already considered legislation that would grant the government the power to ask for the assistance it seeks—but did not end up adopting it. He’s referring here a proposed extension to CALEA, a 1994 law that requires telecommunications companies to provide certain information and assistance to law enforcement. Congress debated expanding CALEA to include companies like Apple, but ultimately didn’t do so.

Second, he rejected the request because it didn’t meet a test established by a 1977 Supreme Court case. That precedent requires a judge to consider three specific factors when deciding whether or not to issue an order under the All Writs Act. The factors are: “the closeness of Apple's relationship to the underlying criminal conduct and government investigation; the burden the requested order would impose on Apple; and the necessity of imposing such a burden on Apple.” Orenstein found the government’s case wanting on all three factors.  

The timing of Orenstein’s order is conspicuous. After considering the government’s request for months, he released his decision the very week that dozens of organizations and individuals plan to file briefs supporting either Apple or the FBI in the parallel case in California.

The help that the government asked from Apple in New York is not the same as what it’s asking in California. In New York, the government wanted Apple to extract data from an iPhone running an older operating system; in California, the government asked Apple to create new software that would help the FBI break into an encrypted iPhone. Apple makes a persuasive case that the government’s ask in California is more burdensome.

One of the points that Orenstein made in his order—that CALEA essentially exempts Apple from being subject to an order under the All Writs Act—is the exact same one Apple lawyers made in the San Bernardino case last week. While Sheri Pym, the magistrate judge in the San Bernardino case, will arrive at her own, independent decision there, Apple’s win in New York won’t go unnoticed.

A senior Apple executive praised the judge’s conclusion in a call with reporters Monday, and noted that it is “precisely on point in the San Bernardino case.”

“This is not a binding precedent,” the executive said, on condition of anonymity. “But this is the first time that a court has looked specifically at this issue.”

Apple CEO Tim Cook has said that he’s willing to take the San Bernardino case all the way to the Supreme Court, so Orenstein’s words may later end up being scrutinized by a panel of justices that is itself in turmoil.