Yahoo, initially vilified for being part of the PRISM program, which allows the National Security Agency (NSA) to tap it and other companies for users’ information, is about to be vindicated.

A court ruled Monday that the Department of Justice must reveal classified documents from 2008 that Yahoo says will demonstrate that the company fought back against a secret court order to reveal their users’ data.

“The Government shall conduct a declassification review of this Court’s Memorandum Opinion of [Yahoo’s case] and the legal briefs submitted by the parties to this Court,” the ruling read. The Department of Justice has two weeks to estimate how long it’ll take to declassify the documents and can still redact the parts it finds contains classified information.

Ironically, it’s the Foreign Intelligence Surveillance Act (FISA) Court that ruled for Yahoo. It was the FISC, often referred to as a “secret court,” that signed off on an order for Yahoo to hand over users’ information in the first place.

That demand came with a gag order, something that’s been particularly stressful to Yahoo, considering the beating its reputation took after former NSA contractor Edward Snowden leaked files that prove that through PRISM, the NSA can apparently easily get Yahoo users’ data.

Yahoo, like all the companies named as part of PRISM, issued a denial that it knowingly aided in such a program. Other companies that denied willfully participating—like Google and Facebook—included the caveat that they do, in fact, comply with court orders.

As the FBI has said, PRISM is legal through the FISA system. Yahoo’s was perhaps the shortest of the major companies’ denials and didn’t address the legality of PRISM at all: “Yahoo! takes users’ privacy very seriously. We do not provide the government with direct access to our servers, systems, or network,” the company wrote.

Also on Monday, the Electronic Frontier Foundation praised Yahoo for putting up a legal fight against FISA in the first place, awarding it a “gold star” in its Who’s Got Your Back survey, which tracks how well major companies stand up for Internet freedom

As the EFF noted, Yahoo’s fight was classified, and other companies might have acted similarly:

“Of course, it’s possible more companies have challenged this secret surveillance, but we just don’t know about it yet. We encourage every company that has opposed a FISA order or directive to move to unseal their oppositions so the public will have a better understanding of how they’ve fought for their users.”

This is only the second known civilian victory in a FISA court. Earlier this month, the EFF itself won a case compelling the FISA court to release some of its previous rulings, and to admit that FISC proceedings are classified by the executive branch, not by the rules of the court itself.

H/[email protected]TrevorTimm | Illustration by Jason Reed