A Boulder man arrested on a child pornography charge studied mass killers such as Oklahoma City bomber Timothy McVeigh, researched how to poison water wells and found addresses of Denver synagogues and mosques, a new court document reveals.

The Denver Post obtained a copy of a federal search warrant affidavit Thursday that offered detailed information about why prosecutors expedited their criminal investigation into 29-year-old Wesley David Gilreath.

The warrant allowed an FBI agent to inspect an Apple iPhone Gilreath used to post a guide on hunting refugees, Jews and Muslims. The phone’s memory chronicled an interest in guns, bombs and other tools of mass murder. It also contained thousands of violent child pornography picture and videos, which gave agents an immediate reason to make an arrest.

On Thursday, U.S. Attorney Jason Dunn said Gilreath’s arrest reflected the office’s high priority of stopping international and domestic terrorists.

“We’re trying to make sure incidents that have happened around the country in Ohio and Texas don’t happen here,” Dunn said. “We’re on guard, for sure, right now.”

On Saturday, a gunman shot and killed 22 people at a crowded El Paso department store, in what is being investigated as a domestic terror incident. Less than a day later, a gunman killed nine people in Dayton, Ohio.

“We are particularly vigilant for those types of civil and criminal hate crimes,” Dunn said.

No charges have been brought against Gilreath related to any specific terror plan or act.

The search warrant affidavit illustrates why federal Magistrate Judge Scott Varholak ordered Gilreath detained without bond on the pornography charge Tuesday because of “clear and convincing evidence” he is dangerous to the community. Varholak’s order cited Gilreath’s possession of many white supremacist documents and his interest in obtaining addresses of local houses of worship.

On May 24, Gilreath tried to buy a firearm in a Boulder gun store but failed a Colorado Bureau of Investigation firearm background “instacheck” when it was revealed he was deemed a “mentally defective,” the arrest affidavit said.

Upon obtaining a court-ordered search warrant on July 25 to examine Gilreath’s phone, federal agents found video footage of a March 15 mass shooting at mosques in Christchurch, New Zealand. Video had been saved on the phone the same day as the attacks, the arrest affidavit revealed.

A note was entered on the smartphone referring to McVeigh’s interest in C4 explosives with information on how to make homemade C4 explosives and “improvised munitions.”

Between May 24 and May 28, someone had used the iPhone’s browser to search for specific guns including the “best small 380 pistol.”

The iPhone’s browser had been used to look up the “United Nations Association of Boulder County;” mosques and Islamic schools in metro Denver and Boulder, and Colorado synagogues. Searches had been made about how to poison a well and about uranium thorium fusion bombs, the search warrant affidavit said.

Dunn said his staff regularly contacts church groups on Colorado’s Western slope and the Denver metro area. They have held seminars to educate leaders about how to prevent, prepare for and respond to terror attacks.

Federal and state agents are working together to build relationships and open dialogues with church leaders so that these groups can help identify people susceptible to hate messages, Dunn said.

“We actively protect houses of worship,” Dunn said. “We use every tool in the tool box to make sure people are safe from international and domestic acts of terrorism.”