BUFFALO, N.Y. -- As the investigation continues into 44-year-old Arafat Nagi's alleged connection to the terrorist group ISIS, a federal judge decided Friday that he will stay in custody without bail. 

"Mr. Nagi is considered to be so dangerous that there would be no conditions which would assure the safety of the community short of jail pending trial," said William Hochul, U.S. Attorney. 

Nagi was arrested Wednesday after the U.S. Attorney's Office said he pledged allegiance to ISIS and its leader, purchased several items of military combat gear and traveled to Turkey twice to help the group. 

"A lot of the allegations that they make against Mr. Nagi are statements made in an alleged Twitter account that he's had or to other people and anyone is allowed to make political speech or religious speech," said Jeremy Schwartz, Nagi's attorney.  

During Nagi's detainment hearing, prosecutors said he had access to his brother's assault rifle and they found a carrying case for a large weapon as well as several tactical knives and a sword in their search of his Lackawanna home. 

"ISIL obviously uses swords to commit beheadings and obviously he had those similar type items at his residence," said Assistant U.S. Attorney Timothy Lynch.

"None of those were illegal items and they don't have any evidence he was going to use those unlawfully against anyone," said Schwartz.  

The prosecution believes he did have dangerous intentions. They said while in Turkey, Nagi searched the Internet about traveling to a city on the Syrian border, and which travel points were controlled by ISIS, Turkey or Syria. 

"Those searches obviously pointed us in the direction that his intent was not to stay in Turkey, he wasn't there simply for a vacation, it was for other purpose, to travel to Syria where al Bagdadi and ISIL is centered," said Lynch. 

Lynch also said Nagi had conversations with his sister about talking to "them" and saying "they" were only a few hours away. Schwartz stressed the name of the terrorist group was not included.

"Even if he wanted to go to Syria doesn't mean that he was going to join a terrorist group there," said Schwartz. 

Schwartz said if Nagi did want to join ISIS, he could have on one of his previous trips, and much of the case is speculative. However the FBI said they believe Nagi became radicalized and it was eminent he was going to travel and do something. 

"We do not require that the government wait until an actual crime of violence is committed and people are hurt, but rather, in many cases, the legislature and in our case congress says that an attempt to commit a crime is sufficient to prosecute," said Hochul.