“This case is unlike anything we have encountered,” said Ralph S. Boelter, the special agent in charge of the F.B.I.’s Minneapolis office, which is leading the investigation.

Most of the men are Somali refugees who left the Twin Cities of Minneapolis and St. Paul in two waves, starting in late 2007. While religious devotion may have predisposed them to sympathize with the Islamist cause in Somalia, it took a major geopolitical event  the Ethiopian invasion of their homeland in 2006  to spur them to join what they saw as a legitimate resistance movement, said friends of the men.

For many of the men, the path to Somalia offered something personal as well  a sense of adventure, purpose and even renewal. In the first wave of Somalis who left were men whose uprooted lives resembled those of immigrants in Europe who have joined the jihad. They faced barriers of race and class, religion and language. Mr. Ahmed, the 26-year-old suicide bomber, struggled at community colleges before dropping out. His friend Zakaria Maruf, 30, fell in with a violent street gang and later stocked shelves at a Wal-Mart.

If failure had shadowed this first group of men, the young Minnesotans who followed them to Somalia were succeeding in America. Mr. Hassan, the engineering student, was a rising star in his college community. Another of the men was a pre-med student who had once set his sights on an internship at the Mayo Clinic. They did not leave the United States for a lack of opportunity, their friends said; if anything, they seemed driven by unfulfilled ambition.

“Now they feel important,” said one friend, who remains in contact with the men and, like others, would only speak anonymously because of the investigation.

The case has forced federal agents and terrorism analysts to rethink some of their most basic assumptions about the vulnerability of Muslim immigrants in the United States to the lure of militant Islam. For years, it seemed that “homegrown” terrorism was largely a problem in European countries like Britain and France, where Muslim immigrants had failed to prosper economically or integrate culturally. By contrast, experts believed that the successful assimilation of foreign-born Muslims in the United States had largely immunized them from the appeal of radical ideologies.

The story of the Twin Cities men does not lend itself to facile categorizations. They make up a minuscule percentage of their Somali-American community, and it is unclear whether their transformation reflects any broader trend. Nor are they especially representative of the wider Muslim immigrant population, which has enjoyed a stable and largely middle-class existence.