Apple can firmly put a notch in the win column today: A federal judge in Brooklyn ruled that the tech company didn’t have any obligation to unlock one of its phones at the request of the U.S. government.

The phone in question was at the center of a drug case, which prosecutors were attempting to break open by forcing Apple to unlock a suspect’s iPhone under a law called the All Writs Act. Magistrate Judge James Orenstein ruled that the government’s request, which is very similar to the FBI’s ongoing case in California over access to a phone connected to the San Bernardino shootings, overstepped the bounds of the All Writs Act by forcing Apple to comply with the government against its will.

You can read Orenstein’s 50-page ruling here. Simply put — he goes at it, blasting the government’s requests as a “betray[al] of constitutional heritage.”

While Orenstein’s ruling does not immediately change the legal proceedings in the San Bernardino case, it could be recognized as a legal precedent for maintaining privacy.

The All Writs Act is also at the center of the San Bernardino case, but the FBI is asking for even more than the government did in Brooklyn — they want Apple to create entirely new software to give investigators access to their devices, which could compromise their security. Still, according to NBC News, Apple has stood up to requests to extract information from over a dozen phones in at least four states, meaning their legal war with the government has a lot of battles for precedent left.

On Tuesday, Apple’s top lawyer will go before the House Judiciary Committee to talk about the San Bernardino case. In prepared testimony released today, the company’s chief counsel, Bruce Sewell, will say this about encryption: “Encryption is a good thing, a necessary thing. We have been using it in our products for over a decade.”