Kola Ray, who lives in the same apartment complex as the Mohamud family, said she remembered seeing Mr. Mohamud very late at night, hanging out with other teenagers near the mailboxes beside the complex’s parking lot. She said the image stayed with her because an older man was often with them and seemed to be speaking to them as a group. She said she did know who the man was.

Although Mr. Mohamud’s arrest marks another episode in which a Somali-American has been accused of radical attempts at violence, there was no evidence that Mr. Mohamud had any current link to Somalia or was a sympathizer of the Shabab, a militant Islamic group in Somalia. And despite Mr. Mohamud’s contacts with militants abroad, officials said he appeared to have acted alone in his pursuit of the bombing here.

His case resembles several others in which American residents, inspired by militant Web sites, have tried to carry out attacks in the name of the militant Islamic movement only to be captured in a sting operation.

In a similar case in September 2009, a 19-year-old Jordanian was arrested after placing a fake bomb at a 60-story Dallas skyscraper. The same month, a 29-year-old Muslim convert was charged with placing a bomb at the federal building in Springfield, Ill. And in October, a 34-year-old naturalized American citizen born in Pakistan was arrested and charged with plotting to bomb the Washington subway after meeting with undercover agents and discussing his plans and surveillance activities.

On Saturday, Muslim and Arab American leaders in Oregon and southwest Washington condemned the attack in a joint statement, calling it “inexcusable and without any justification in Islam or authentic Muslim tradition.”

At a news conference later, representatives of several Portland mosques asserted their confidence in law enforcement officials’ actions so far. Afterward, three of the gathered community members bowed in prayer near the entrance to the Portland City Hall.