A worldwide FBI search of hundreds of computers purportedly used to access a secretive child pornography website was unconstitutional, Minnesota's chief federal judge wrote on Monday.

But the judge refused to throw out evidence that resulted from the search and that was used to prosecute a man from Coleraine, Minn., after he found no signs of FBI misconduct in the probe.

U.S. District Judge John Tunheim rejected a magistrate judge's recommendation to suppress evidence and statements made by suspect Terry Lee Carlson during the FBI's controversial investigation into Playpen, a "dark web" child pornography network that once counted 150,000 users.

Carlson, who is awaiting trial on 11 child pornography counts, became one of more than 900 people arrested around the world in a takedown that has produced dozens of court challenges.

Tunheim noted that a three-judge panel in the Eighth Circuit reversed an Iowa judge's decision to throw out evidence in a case that also stemmed from the FBI's "Operation Pacifier."

Tunheim's decision mirrored numerous other federal court rulings in concluding that agents unconstitutionally exceeded the scope of a Virginia search warrant. The FBI deployed a "network investigative technique (NIT)," described by some as a form of malware, to gather IP addresses and other information on users of the porn website, which formed the backbone of federal criminal cases like Carlson's and those of at least three other Minnesotans.

But, citing a Supreme Court precedent, Tunheim wrote that because the FBI "acted in good faith and generally followed proper procedures in requesting and executing the warrant," evidence gathered against Carlson can stand.

The FBI arrested the operator of Playpen in 2015 and seized the website's server. But it kept a copy of the website running while deploying its NIT to target hundreds of users around the country based on a search warrant signed by a Virginia magistrate judge.

In his March opinion recommending that Tunheim strike evidence from a pair of searches in 2015 and 2016 and statements Carlson made to agents, U.S. Magistrate Judge Franklin Noel also questioned the FBI's decision to keep a copy of Playpen running, writing that "in essence, the FBI facilitated the victimization of minor children and furthered the commission of a more serious crime."

A federal prosecutor in the case, Assistant U.S. Attorney Carol Kayser, responded a month later by calling any suggestion of FBI misconduct "untenable" and defended the far-reaching computer searches as "a troubling indication of how prevalent these crimes are in our society."

Agents arrested Carlson last November after a second search of his home and after he confessed to producing child pornography in a subsequent interview with law enforcement.

During an early search, the FBI seized electronic devices and found evidence that Carlson also produced and distributed child pornography, according to court filings.

Carlson's attorney, Lee Johnson, declined to comment on Tunheim's order Monday. The U.S. attorney's office also declined to comment on the case, which is scheduled for a September trial.