Four young Somali-Americans from the Twin Cities will remain in jail as they await trials on terrorism charges.

More than 200 supporters of the young men packed two rooms in the federal courthouse in St. Paul on Thursday, as a judge considered if the cases should move forward — and if the four should be released or remain behind bars.

The men were arrested Sunday around the Twin Cities, the same day two other young men were arrested in California. All six are accused of making plans to travel to Syria to join the Islamic State of Iraq and the Levant, or ISIL, an extremist group

In court Thursday, one of the FBI agents involved in the 10-month-long investigation into the group’s activities said officials gathered evidence in part by wiretapping phones and using a confidential informant.

Prosecutors say Zacharia Yusuf Abdurahman, Adnan Abdihamid Farah, Hanad Mustafe Musse and Guled Ali Omar made plans — or in some cases, actual attempts — to leave the Twin Cities by bus or plane to go overseas.

Defense attorneys attacked the credibility of the informant, who they say was involved in plans to join ISIL — and lied under oath about his activities — before deciding to work with the FBI. They also pointed to their clients’ clean records and close ties to their families and community. The men are all between the ages of 19 and 21, and some are currently enrolled in community college.

A prosecutor contended that officials have multiple types of evidence revealing that all four men intended to join the terrorist group.

When some of the men were stopped by agents waiting at airports in Minneapolis and New York City, FBI Special Agent Harry Samit said they claimed to be taking vacations but showed unusual behavior that aroused investigators’ suspicions: one carried no luggage for a flight to San Diego, while others booked short trips to various destinations in Europe but couldn’t explain their specific travel plans.

Abdirahman Yasin Daud and Mohamed Abdihamid Farah, the two men currently being held in California, were arrested in San Diego, allegedly en route to Syria.

Another man suspected of being involved with some of the men now facing charges, Hamza Naj Ahmed, was indicted in February on charges of lying to FBI agents. He was stopped by federal agents after he had boarded a plane in New York that was bound for Spain.

Ahmed allegedly told investigators that he planned to vacation alone in Madrid and denied knowing the other defendants’ travel plans.

Samit, the FBI agent, told U.S. Magistrate Judge Becky Thorson on Thursday that one of the defendants was in touch with another man who’d promised to connect the others with passports they could use to leave the country.

But when those passports didn’t materialize, the FBI directed its informant to tell the other men that he had a connection that could provide passports. He collected photos and down payments for the passport fees, which were then turned over to investigators.

The description of the informant’s activities — and the fact he’d been paid — prompted murmurs in the courtroom and outrage on social media.

Samit said the informant has been paid $12,700 since he began cooperating with officials in February.

A prosecutor twice noted that officials are monitoring threatening comments directed at the informant and his family, and would investigate the matter.

Defense attorneys argued that the prosecutors’ case hinged on the testimony of a man whose credibility has been called into question and provided little other evidence of intent to commit a specific crime.

Some said their clients had shown no signs of becoming more religious or changing the way they dressed or behaved. One had recently become engaged, while others held down jobs while attending school.

If anything, the attorneys said, their clients had talked or thought about terrorist groups but in doing so had not committed a crime.

“In our country, for better or worse, you can think bad things … but it’s not a crime,” said Paul Engh, the attorney representing Adnan Farah.

Tensions in and outside the courtroom remained high through the five-hour proceedings. At different times, at least a half-dozen people were escorted out by federal marshals for making comments or using cellphones.

Defense attorneys asked Thorson to consider allowing the men to be released to the care of relatives, or to a halfway house where they would be put under electronic surveillance. They argued that the conditions in jail — where some of the men were being held in solitary confinement and shackled when they met with lawyers — would do more harm than good.

Thorson said she carefully weighed all of the arguments but believed the charges were too serious and that the men posed too much of a flight risk to be let out of custody.

“The question has always been the trust level between law enforcement and community,” said Somali community activist Omar Jamal, pointing to a federal pilot program aimed at improving relations between the Somali community and law enforcement. But, he added, “the events today that happened were not very helpful to the overall picture.”

As the judge finished announcing her decisions, one young man stood up.

“You cannot weigh anything without evidence, ma’am,” he shouted, as U.S. marshals moved in to remove him from the courtroom. “We are the community. You should ask us.”