When Minnesota Somalis began traveling to their war-torn homeland to take up arms nearly three years ago, authorities initially feared they might someday return as domestic terrorists.

But recent court activity suggests at least some of the men are not as dangerous as once feared. Five have been allowed to go free with various conditions as their cases work through the court system, including two who admitted spending time in a terrorist training camp. After months in custody, the pair have gradually received more freedom, and are now living with family members.

"Judges tend to err on the side of caution in these cases," said Stephen Vladeck, an associate law professor at American University in Washington. So for a court to release a terrorism suspect, the judge "found clearly and convincingly that the defendant is not a threat."

Roughly 20 men — all but one of Somali descent — left Minnesota from December 2007 through October 2009 to join al-Shabab, a violent group that seeks to establish an Islamic state in Somalia. The federal government designated al-Shabab a foreign terrorist organization in March 2008, and said it has ties to al-Qaida.

The threat posed by al-Shabab took on more urgency last week, when the group claimed responsibility for twin bombings in Uganda that killed 76 people during the World Cup final. It was the first time al-Shabab had struck outside Somalia's borders. In a new audio message released Thursday, the militant group's leader threatened further attacks.

It's unclear whether any Minnesota men were involved in the attack. The FBI is assisting the investigation in Uganda.

Federal officials are still seeking some of the Minnesota suspects, and authorities warn the group could still pose a threat in the future.

"These individuals still present a dangerousness because of the ideology involved and the training that they get in camps," said E.K. Wilson, an FBI spokesman in Minneapolis.

At least initially, many of the men appear to have been motivated not by anger at America but at turmoil in their Somali homeland, which has not had a functioning government since 1991, when warlords overthrew a socialist dictator and then turned on each other, plunging the African nation of 7 million into chaos.

In late 2006, Ethiopian soldiers were brought into Somalia by a weak U.N.-backed government that was struggling to regain control of the country. Many Somalis saw that occupation as an invasion, and they viewed the Ethiopian soldiers as abusive and heavy-handed.

In Minnesota, home of the largest population of Somali immigrants in the United States, anti-Ethiopian sentiment became commonplace — in coffee shops, households and public venues.

By the fall of 2007, some Somali men were holding secret meetings at Minneapolis mosques and homes, plotting ways to fight the Ethiopians, court documents said.

The men were accused of varying degrees of involvement in the movement to return to Somalia. Court documents say some helped pay for weapons or travel. Another person came up with a fundraising scheme. Others went to Somalia to learn to use machine guns and rocket-propelled grenades. At least one man helped ambush Ethiopian troops. Someone else carried out a suicide bombing.

"Nationalism may have played a role in the initial attraction or initial draw of these individuals, but radicalism and violent extremism at some point was introduced to many of them," Wilson said.

Charges have been filed against 14 men — including some people who traveled to Somalia and some who did not. Seven of those charged are still at large. One man is in the Netherlands fighting extradition to the U.S., a process that could take many more months.

All except one of the men who are in Minnesota were deemed fit for release with some conditions. For instance, Salah Osman Ahmed and Abdifatah Yusuf Isse both went to Somalia and later pleaded guilty to providing material support to terrorists. Their restrictions were gradually lifted over time — to the point where they are now at family homes and no longer on electronic monitoring.

Attorneys for the two said their clients went to Somalia to fight the Ethiopian army, but left the training camps before al-Shabab was declared a terrorist organization. Ahmed helped clear brush and trees for a camp, and Isse helped build a camp, according to court documents.

It's not clear when they will be sentenced. Their attorneys declined to make them available for interviews.

The others who are free include one man who awaits trial for allegedly helping some of the travelers, and one who pleaded guilty to perjury. Another man, Abdow Munye Abdow, was sentenced Friday to four months in prison, followed by four months' home detention, for obstruction of justice. Abdow, who did not travel to Somalia but lied to investigators, is free while awaiting his prison assignment.

The only suspect to remain in custody in Minnesota is Kamal Said Hassan, who is accused of traveling to Somalia in December 2007 with Ahmed, staying al-Shabab training camps, and continuing to work with al-Shabab after his training. He has pleaded guilty to providing material support to a foreign terrorist organization and other charges.

The Minnesota investigation is not over. Authorities say the case is complex because of national security issues, the number of suspects, and the geography and the lawlessness of Somalia.

A significant part of the case is at an "advanced stage," Wilson said, but "there are still questions that we have, questions that we are trying to answer."