A federal judge ruled today that the FBI did not obtain the proper warrant before hacking a child porn website and that the evidence it collected against one of the defendants, Alex Levin, must be suppressed.

The case centers on a child porn site called Playpen, which was hosted on a hidden Tor service intended to conceal users’ identities. The FBI seized the site’s server in February of last year, but instead of shutting it down, the agency continued to run the site on its own server for several weeks. During that period, the FBI implemented its own hacking tool, referred to as a network investigative technique (NIT), to collect the IP addresses of visitors to the site. The FBI is thought to have obtained thousands of IP addresses during the investigation.

One of the IP addresses allegedly belonged to Levin, a Massachusetts man who is charged with possession of child pornography.

Levin’s public defender successfully argued that the warrant the FBI used to authorize the NIT was not valid because it was issued by a magistrate judge in Virginia, and Levin’s computer — located at his home in Massachusetts — was outside that judge’s jurisdiction.

In today’s ruling, Judge William G. Young said that the evidence against Levin, including “eight media files allegedly containing child pornography,” must be suppressed.

“The court concludes that the NIT Warrant was issued without jurisdiction and thus was void,” Young wrote. “It follows that the resulting search was conducted as though there were no warrant at all.”

Young also expressed skepticism at the ethics of the FBI running a child porn site. “Unlike those undercover stings where the government buys contraband drugs to catch the dealers, here the government disseminated child obscenity to catch the purchasers — something akin to the government itself selling drugs to make the sting,” he wrote.

The ruling is a victory for privacy advocates, who argued that the FBI should not be permitted to hack thousands of computers across the United States — and potentially around the world — all at once.

“The FBI could have handled this investigation in a different way, but they failed to,” Electronic Frontier Foundation staff attorney Mark Rumold told TechCrunch. The EFF has argued in another Playpen-related case that the NIT warrant was unconstitutional. “They just cast their net as wide as they could, and now they’re having to fight tooth and nail to bring these prosecutions. If they had done it in a way that was targeted in the first place, they wouldn’t have this problem,” he added.

Although this ruling is likely the end of the case against Levin, other defendants linked to Playpen are standing trial across the country. Judges in those cases are not bound to follow Young’s ruling, and those cases may still proceed. The Justice Department may also continue to bring charges against other suspected Playpen users — but Rumold says that’s not a good idea.

“At this point, there were so many problems with the way the FBI conducted this investigation that DOJ should just stop bringing these cases,” Rumold said.