His internet searches included how to make bombs, and what kinds of blast radii certain devices would create, Starnes said. His targets included gay clubs, federal buildings and a U.S. Army recruiting center.

Charging documents show Alameti came to Montana in March and watched the video of a New Zealand shooter slaughtering people at two mosques there on March 15. He had hoped to avenge the shooting, Starnes said.

"He came to Montana because all they need is a background check or an ID" to purchase a firearm, Starnes said during the hearing.

While staying at a Bozeman hotel, Alameti was hospitalized for alcohol intoxication. A hotel manager unhappy with Alameti smoking marijuana in the hotel room turned over all his belongings to law enforcement. After his release from the hospital, Alameti went to the law and justice center there to collect his things, but was brought into an interrogation room.

During that interview, Alameti told authorities he never talked about traveling overseas to fight for ISIS, and never wanted to hurt any Americans or anyone in the military.

"What did you do that was false?" DeSoto asked him at the Wednesday hearing.

"Lying to them about terrorism," Alameti responded.