SEATTLE — Navy criminal investigators repeatedly and routinely peeked into the computers of private citizens in Washington state and elsewhere, a violation of the law so “massive” and egregious that an appeals court says it has no choice but to throw out the evidence against an Algona, Wash., man sentenced to 18 years in prison for distribution of child pornography.

The three-judge panel of the U.S. 9th Circuit Court of Appeals, in a decision handed down last week, said the 2012 prosecution of Michael Allan Dreyer by the U.S. Attorney’s Office in Seattle demonstrated Naval Criminal Investigative Service (NCIS) agents “routinely carry out broad surveillance activities that violate” the Posse Comitatus Act, a Reconstruction-era law that prohibits the military from enforcing civilian laws.

The court called the violations “extraordinary” and said evidence presented in Dreyer’s prosecution appears to show that “it has become a routine practice for the Navy to conduct surveillance of all the civilian computers in an entire state to see whether any child pornography can be found on them, and then to turn over that information to civilian law enforcement when no military connection exists.”

That is what happened to Dreyer, now 60, who became the target of an NCIS investigation in 2010 when Agent Steve Logan, who was stationed in Georgia, used a law-enforcement software program called “RoundUp” to troll for child pornography on computers in Washington using a legal file-sharing network called “Gnutella.”

According to court documents, Logan identified a computer sharing suspicious files, downloaded three of them, then got a subpoena for Comcast, which identified Dreyer as the IP address owner.

Logan, according to court documents, checked to see if Dreyer was a member of the armed forces and determined he was not.

Logan then summarized his investigation and forwarded it to the NCIS office in Washington state, which turned it over to the Algona Police Department, according to the documents.

The case was filed by the U.S. Attorney’s Office in federal court, where Dreyer faced up to 40 years in prison due to a prior conviction.

Dreyer was arrested in April 2011 and fought to suppress the evidence, which included explicit videos of adults having sex with preteen boys and girls.

U.S. District Judge Marsha Pechman allowed the videos to be used and Dreyer was convicted of possession and distribution of child pornography after a four-day jury trial in September 2012.

Dreyer—who previously had served 27 months for a federal child-pornography conviction in 2000 — was sentenced to 18 years in prison and a lifetime of supervised release when he gets out.

However, the 9th Circuit judges found the NCIS behavior so outrageous that it “demonstrates the need to deter future violations” and sent Dreyer’s case back to the district court with an order that Pechman exclude the NCIS evidence against him.

Erik Levin, the former federal public defender who represented Dreyer during his trial and appeal, said the ruling likely means he will go free.

The U.S. Attorney’s Office is considering asking the case be reheard by the entire Court of Appeals. U.S. Attorney Jenny Durkan, whose office prosecuted Dreyer and argued the appeal, said Wednesday it is possible the court misunderstood some of the technology the agent was using and the scope of his searches.

Durkan said some information in the 9th Circuit’s opinion “is wrong.”

Otherwise, she said she could not comment on pending litigation.

Telephone and email messages sent to NCIS headquarters in Washington, D.C., were not returned Wednesday.

The government, in its appellate briefs, argued Logan was a civilian employee of the NCIS, and that his role in the investigation was peripheral and fell within exceptions to the Posse Comitatus Act.

The panel unanimously, and strongly, disagreed.

Senior 9th Circuit Judge Andrew Kleinfeld found that the case “amounts to the military acting as a national police force to investigate civilian law violations by civilians.”

“There could be no bona fide military purpose to this indiscriminate peeking into civilian computers,” Kleinfeld wrote. “Letting a criminal go free to deter national military investigation of civilians is worth it.”

The judges also excoriated the government for defending the role of the NCIS and its investigation and said the court has warned the Justice Department about it before. This time, the court said, the violation comes with a price to get the government’s attention—Dreyer’s release from prison.

“Such an expansive reading of the military role in the enforcement of civilian laws demonstrates a profound lack of regard for the important limitations on the role of the military in our civilian society,” wrote Judge Marsha Berzon.

Logan, the NCIS agent, had argued he had chosen to scan computers in Washington partly because of the state’s many military bases.

While he initially was only able to identify the suspect’s whereabouts within a 30-mile radius of the IP address he identified, he wrote in a search warrant that the “large [U.S. Navy/Department of Defense] saturation” indicated a “likelihood” the suspect was in the military.

By that logic, Berzon said, Posse Comitatus would be “rendered meaningless.”

“To accept that position would mean that NCIS agents could, for example, routinely stop suspected drunk drivers in downtown Seattle on the off-chance that a driver is a member of the military, and then turn over all information collected about civilians to the Seattle Police Department for prosecution.”

The opinion comes as the reach of government and law enforcement has come under fire after a series of disclosures of domestic surveillance by former National Security Administration systems analyst Edward Snowden.

Levin, who now practices law in Berkeley, Calif., also noted the controversy over the so-called “militarization of police” in the aftermath of the riots in Ferguson, Mo., following the shooting death by police of a black teenager. Exceptions to the Posse Comitatus Act allow the military to provide some equipment to police.

“This,” Levin said, “is the real militarization of police—when the military becomes the police.”

©2014 The Seattle Times. Distributed by MCT Information Services