Federal agents have arrested a 29-year-old Boulder man on a pornography charge, and the U.S. attorney in Colorado said the arrest may have prevented a domestic terrorist attack because the man also is suspected of writing an online guide on how to commit violent hate crimes against refugee centers, synagogues and mosques.

Wesley David Gilreath was charged Tuesday with possession of child pornography, but federal law officers also arrested him in order to potentially stop a domestic terror attack, according to a statement by U.S. Attorney Jason Dunn.

“The charge in this case demonstrates that the U.S. Attorney’s Office and our federal and state law enforcement partners will use every available law enforcement tool not just to prosecute federal crimes, but also to disrupt and prevent potential hate crimes,” Dunn’s statement said.

Magistrate Judge Scott Varholak ordered Gilreath detained without bond on the pornography charge Tuesday during a hearing in U.S. District Court. The investigation against Gilreath for other possible federal crimes is continuing, Dunn wrote in his statement.

In denying Gilreath’s pre-trial release, Varholak wrote in a detention order that by “clear and convincing evidence” the suspect is dangerous to the community and a flight risk. The judge noted that federal prosecutors verbally offered supplemental information about Gilreath at the bond hearing.

“He had searches for a book that is a guide to gaining children’s trust,” Varholak’s order said of Gilreath. “He also had numerous white supremacist documents and paraphernalia. He had posted a ‘hunters’ guide,’ which contained information about mosques and synagogues. He had other lists with local mosque and synagogue addresses.”

Judge Varholak noted in his order that Gilreath had recently attempted to purchase a gun and had previously failed multiple times to appear for court hearings.

In January, an FBI agent allegedly confirmed that Gilreath posted a so-called “Montana Hunting Guide” online after the FBI received a tip that someone was posting hunting guides targeting Jews, Muslims, Montana National Guard facilities, Bureau of Land Management offices and a refugee center, according to an arrest warrant affidavit.

Such guides may be used to violently target people of different ethnicities, religions or political views, the arrest warrant affidavit said.

Gilreath was not arrested at the time.

Gilreath came under federal scrutiny again in May after his father’s Apple iPhone, which Gilreath had been using, was left on an RTD bus.

The phone contained thousands of violent child pornography photographs, the affidavit said.

Gilreath faces up to 10 years in prison on the child pornography charge.