Updated

A Minneapolis man accused of threatening FBI agents and a judge over Twitter after his friend was arrested for allegedly conspiring to help the Islamic State group will have his case go before a federal grand jury for review, a judge ruled Wednesday.

Khaalid Adam Abdulkadir, 19, is charged with one count of impeding and retaliating against a federal law enforcement officer. During a preliminary hearing, U.S. Magistrate Judge Franklin Noel found there was probable cause to believe a crime was committed and he allowed the case to proceed. Abdulkadir will remain in custody pending a Monday detention hearing.

Authorities say Abdulkadir posted the threatening tweets last week after his friend, Abdirizak Mohamed Warsame, was arrested on one count of conspiring to provide material support to the Islamic State group. According to court documents, within hours of Warsame's arrest, Abdulkadir posted two tweets that contained threats. One included the words "kill them FBI." The other included, "I'm kill them FEDS for take my brothers."

Abdulkadir's attorney, Chris Madel, said during Wednesday's hearing that no FBI agents or judges were named in the tweets and he questioned whether someone else posted the comments. Madel also argued that the idea behind the tweets, a frustration with law enforcement, was protected speech.

Madel also said an FBI document summarizing Abdulkadir's arrest notes that he "emphatically denied threatening anyone."

Assistant U.S. Attorney John Docherty said words like "kill them FBI" are not protected under the First Amendment and it's not necessary for a threat to identify a person by "name, rank and serial number."

FBI Special Agent Vadym Vinetsky testified that Abdulkadir used social media in the past to communicate with one Minnesota man who left the state in 2008 to join al-Shabab in Somalia and another who left in 2014 to join the Islamic State in Syria. Vinetsky testified that Abdulkadir told both men he wanted to travel to Syria.

Abdulkadir's case is similar to that of another Minnesota man, Mahamed Abukar Said, who was charged for tweeting "ima whack that us attorney general" after six men were arrested on terrorism charges in April. Said pleaded guilty to a reduced misdemeanor charge and faces up to a year in jail when sentenced this month. Madel, also Said's defense attorney, argued that the target of the alleged threat was never clear.

___

Follow Amy Forliti on Twitter: http://www.twitter.com/amyforliti . More of her work can be found at http://bigstory.ap.org/content/amy-forliti