Updated

A Minneapolis man who's charged with tweeting threats against FBI agents and a judge after his friend was arrested on a terrorism charge will remain jailed without bail pending further proceedings, a federal magistrate judge ordered Monday.

U.S. Magistrate Judge Franklin Noel found the government had met its burden of proof for keeping Khaalid Adam Abdulkadir, 19, in custody, but said it was "an awfully close question."

Abdulkadir, a pre-nursing student at Minneapolis Community and Technical College, is charged with one count of impeding and retaliating against a federal law enforcement officer. Authorities allege he posted threatening tweets after the Dec. 9 arrest of his friend, Abdirizak Mohamed Warsame, on one count of conspiring to provide material support to the Islamic State group. Warsame's own detention hearing is scheduled for Tuesday.

Defense attorneys told Noel that the government has yet to prove that Abdulkadir posted the tweets or that he exchanged messages via social media earlier this year with two men who prosecutors say left Minnesota — one to fight for the Islamic State group and one to fight for al-Shabab in Somalia.

Prosecutors allege in court papers that the messages show that Abdulkadir aspired to fight for the Islamic State. But Adulkadir's mother and one of his brothers both testified that he is "not very religious" and doesn't support the group.

His mother, Dequa Warsame, said Abdulkadir considers Islamic State and al-Shabab fighters to be "crazy people" who kill innocent people and children, and that he wished the groups didn't exist.

His 18-year-old brother, Mohamed Abdulkadir, testified that they share a bedroom and that he never showed any interest in jihad. He said his brother's main interest in life is his girlfriend.

Court papers show one of the tweets included the words, "I'm kill them FEDS for take my brothers" and contained an obscenity followed by a reference to an unnamed judge. The other tweet included the words "I'm kill them FBI."

"The plain text of these tweets is very alarming and threatens violence," Assistant U.S. Attorney John Docherty told Noel.

Noel suggested that was a reasonable reading of the ungrammatical tweets.

But defense attorney Aaron Thom argued that the language was so vague that it "could be taken so many ways by so many people."

To bolster its claims that Abdulkadir was no flight risk or danger to the community, the defense also played a two-minute video of Abdulkadir speaking at his high school graduation ceremony this summer, expressing hope of someday becoming a doctor.

Those weren't the words of someone plotting to join a terrorist group, defense attorney Chris Madel said. And he added that that's why the defense is "zeroing in" on the government's failure so far to provide authentication that Abdulkadir sent the tweets or exchanged messages with fighters abroad.

Docherty disputed that the evidence to authenticate the messages is weak, though it hasn't been provided to the defense yet. He also said the government has Abdulkadir's iPhone, but it's locked and can't be unlocked.