LARVIK, Norway — As a boy, the Somali immigrant sold newspapers door to door in this peaceful seaside Norwegian town and told neighbors he was going to be a doctor and help people in Africa.

In high school, he began taking a prayer rug to school, but in a community with many Somalis — not to mention Muslims from Libya, Chechnya and elsewhere — he hardly stood out. He rarely got into even mild trouble.

But with grades that fell short of medical school requirements, the young man, Hassan Abdi Dhuhulow, struggled to find a job after high school and began visiting radical jihadist Web sites. In 2009, he took the first of several long trips back to Somalia.

Norwegian investigators now want to know whether the boy who wanted to be a healer grew up to be a killer. They are questioning relatives and friends of Mr. Dhuhulow, 23, to try to determine whether he was one of the four attackers caught on surveillance cameras during the rampage at the Westgate shopping mall in Nairobi, Kenya, last month, when more than 60 men, women and children were killed.

The investigators suspect he was the killer whom investigators have been referring to as Black Shirt, seen hustling past a jewelry store firing his rifle; stalking a wounded man desperately trying to hide in the grocery store; and limping with a bandage below his left knee, his lower leg soaked in blood.

An official familiar with the investigation in Norway confirmed that the Police Security Service had been keeping track of Mr. Dhuhulow since he was a student at Thor Heyerdahl High School, near where he grew up. NRK, the Norwegian state broadcaster, quoted police sources as saying that he had been in contact with central figures of a Norwegian-based Islamist group, Profetens Ummah, or the Prophet’s Community of Believers.

TV 2 in Norway reported that Mr. Dhuhulow had been active in an online forum linked to the Shabab and posted photographs of “martyrs” killed in Bosnia. On one site, TV 2 reported, his profile picture was a suicide bomber.

The local newspaper Ostlands-Posten quoted an unnamed former classmate as saying that in high school Mr. Dhuhulow was looking at “odd Web sites,” including more than one about “liquidating” American soldiers. The newspaper reported that several former classmates had recognized his gait and his hand gestures in the video footage.

Mr. Dhuhulow’s sister, speaking on the condition that her name not be given, said in an interview here in Larvik: “It’s still hard to believe. I can’t bear the thought of this actually being true. It’s just too much to come to terms with.”

She said that officers from the Police Security Service had asked her whether her brother had placed calls from the Westgate mall during the siege. She said that he had not and that the family was unaware of any role he might have played.

She said she did not believe her brother could have taken part in the attack on Westgate and could not say she recognized him from the video. “My mother and father and me, we don’t even know if he is dead or alive,” she said.

Although a person of interest in the case, Mr. Dhuhulow may yet prove to have had no connection to the attack.

Image

Hassan Abdi DhuhulowCreditAssociated Press

The Police Security Service said in a statement on Friday that it had “not yet been determined whether a named Norwegian citizen actually took part in the attack or not.” But the statement added, “Based on the information that we have uncovered this far in the investigation, however, the suspicion of his involvement has been strengthened.”

A man with the same name as Mr. Dhuhulow was arrested in Somalia in connection with the killing of a radio journalist but was freed by a military tribunal for lack of evidence in March.

The devastating siege of Westgate shocked not just Kenya but the entire region, from Ethiopia to Tanzania, prompting worries of more attacks abroad by the Shabab or the group’s local affiliates. In Uganda’s capital, Kampala, extra police officers were at checkpoints and guarded shopping malls on Friday after warnings of an attack.

The ripples of fear and incomprehension have now spread all the way to this idyllic community of about 43,000 people on Norway’s east coast, with its small white wooden houses and a harbor full of bobbing sailboats. Residents have begun to question how their town could be a cradle of Islamist militancy. The questions are especially poignant for those who came to Norway as refugees precisely to get away from such violence and to give opportunities to children like Mr. Dhuhulow.

“The Somali community in Larvik is in shock,” said Mohammed, a postal worker who visited the mosque here on Friday and, like many fearing repercussions for speaking out, gave only his first name.

Mr. Dhuhulow grew up in a multiethnic neighborhood, in a four-story apartment building with 32 units and families from half a dozen countries.

Tone Olafsen, 59, the vice president of the building’s board, remembered when the family moved in. She said she had spent time with the family and always had a positive impression of Mr. Dhuhulow. “He was a quiet, polite, good-humored, pleasant and nice kid,” Ms. Olafsen said.

Norway has increasingly come into focus in the inquiry into the Westgate attack, as investigators from Kenya, the United States, Norway and elsewhere work to piece together the Shabab’s international network. Navy SEALs staged an unsuccessful raid in Baraawe, a Somali coastal town, this month to try to capture a Shabab planner, Abdikadir Mohamed Abdikadir, also known as Ikrimah. Mr. Abdikadir is believed to have lived in Norway as an asylum seeker between 2004 and 2008.

Lars Akerhaug, the author of “Norwegian Jihad,” said that the free-speech laws in Norway made it particularly easy for militant recruiters to operate.

“If you want a base in Europe, it makes sense to do it here because there’s a smaller chance of being prosecuted here than in a place like Britain or Germany that has stricter terrorism laws,” Mr. Akerhaug said. He pointed out that there were Shabab representatives in Oslo andin Gothenburg, Sweden, and that around 10 Norwegians were known to be fighting for the Shabab.

More and more scenes of the attack have leaked out in the weeks since the siege ended. Disturbing new clips released on Thursday showed terrified shoppers running for their lives while the killers, including Black Shirt, stalked them, leaving victims in pools of blood on the mall floors.

Confirmation of the attackers’ identities could come from the scorched remains of two or possibly three people found near AK-47 rifles and pulled from the rubble of the mall on Thursday. Identification of the charred partial remains will require advanced forensics, including DNA testing, according to Johansen Oduor, the chief Kenyan government pathologist.

“There’s no face,” Dr. Oduor said in an interview. “There’s no clothes.” But, he noted, “if you are found next to an AK, most likely you are one of the attackers.” Kenyan security forces do not use that kind of rifle.