The National Security Agency’s data harvesting program, PRISM, has been the subject of much speculation and controversy since its existence was revealed by former NSA contractor Edward Snowden in 2013.

PRISM is widely regarded as “the NSA spying on everyone’s Internet activity” by the public, which is left to guess at the true extent of the program from a few scraps of hard data, since so much of it remains classified. Recent stories have suggested the scope of NSA surveillance was considerably more narrow than critics feared, but now a ruling from a federal judge suggests that surveillance remains more broad than privacy activists might have hoped.

In essence, the case is about a man arrested on terrorism charges who got caught because the NSA intercepted emails he sent to someone else they had under surveillance.

Vocativ describes the defendant as Agron Hasbajrami, an Albanian citizen living in Brooklyn, who was arrested in 2011 and pled guilty to “trying to travel to Pakistan to join a militant jihadi group, as well as to wiring it money.”

After he was arrested, Hasbajrami was told his emails to another individual were swept up by the PRISM program. He filed a motion to have the evidence against him dismissed, because the warrantless surveillance program violated his reasonable expectation of privacy. If his motion had succeeded, the New York Law Journal cites his attorneys saying his guilty plea would have been vacated.

In a ruling handed down on February 18 but not made public until this week, Federal District Court Judge John Gleeson ruled against Hasbajrami, saying the collection of email evidence against him was “reasonable in light of the Fourth Amendment’s protections.”

The ruling noted that under the relevant law, the FISA Amendments Act of 2008, prosecutors are not required to specify the exact people and places they plan to keep under surveillance when they apply to the Foreign Intelligence Surveillance Court.

To bring this in line with the earlier NSA Inspector General report which portrayed the electronic surveillance programs more limited than critics believed, the NSA might not be “reading everyone’s email,” but they are allowed to consider all intercepts related to investigations authorized by a FISA court. Hasbajrami barged into such an investigation with his email, and became fair game.

The New York Law Journal notes Judge Gleeson was aware there are few things “more unsettling than the idea of a government spying on its own citizens”and acknowledged there has been “legitimate criticism of electronic surveillance practices,” the action against Hasbajrami was reasonable and consistent with the law.

Vocativ notes that Glesson’s ruling provided some of the clearest testimony to date about how the PRISM program works:

In PRISM collection, the government identifies the user accounts it wants to monitor and sends a ‘selector’—a specific communications facility, such as a target’s email address or telephone number—to the relevant communications service provider. A government directive then compels the communications service provider to give it communications sent to or from that selector. This type of surveillance, which intercepts ‘to/from’ communications, can result in the interception of communications with U.S. persons if the target happens to communicate with such a person.”

This is also consistent with the NSA Inspector General’s report, which said it was private-sector Internet providers sifting through data to locate responsive material, rather than government agents.

The Next Web notes this judicial ruling is the first official confirmation that PRISM, which allows the government to collect data directly from the servers of Internet providers, exists as a program distinct from “upstream data collection,” which fishes through data as it flows across the Internet.

“The distinction between programs is important as, to date, the NSA has never verified the existence of its PRISM program. Now, it’s undeniable and could lead to more transparent conversations about government surveillance programs, but that’s probably wishful thinking,” The Next Web ventures.