ST. PAUL, Minn. (AP) — A federal judge has ordered that four Minnesota men accused of trying to travel to Syria to join the Islamic State remain in custody while their case is pending.

Magistrate Judge Becky Thorson made her ruling after several hours of testimony Thursday.

The men are among six charged in a criminal complaint unsealed Monday.

Thorson's ruling caused an outburst in a courtroom packed with more than 100 people, many from Minnesota's large Somali community. One man was led out of the courtroom after he admonished the judge.

All six of the men charged are Somali-American. Minnesota has struggled for years to stem recruiting by militants, first from al-Shabab in Somalia and more recently the Islamic State in Syria.