COPENHAGEN — When Aydin Soei, a sociologist in Denmark, met members of an inner-city gang in 2008, one teenage tough stood out as more intelligent than his peers, and more mercurial. He showed little interest in Islam, but a deep loathing for Denmark, the country where he was born and spent his entire life.
On Sunday, that former gang member, Omar Abdel Hamid El-Hussein, died in a gun battle with Danish police officers just a few hundred yards from his boyhood home in Norrebro, an immigrant area of the Danish capital. It was the final, bloody episode of a short and angry life that included street crime and macho violence and ended with a 15-hour explosion of militancy on the streets of Copenhagen.
Thousands of Danes bearing lighted torches and flags braved icy wind to gather for a mass memorial Monday evening in the Copenhagen neighborhood where the gunman sprayed a cafe with bullets Saturday afternoon. The cafe, whose name translates as “the powder keg,” was hosting a discussion about free speech at the time of the attack.
As the authorities across Europe try to figure out how radical Islam turns a tiny but dangerous minority of young Muslims into terrorists, Mr. Soei, the sociologist, said that Mr. Hussein, 22, was an exemplar of a phenomenon of Europe’s urban neighborhoods, not a product of the teachings of the Quran or their distortions by militant preachers.
“This wasn’t an intellectual Islamist with a long beard,” Mr. Soei said. “This was a loser man from the ghetto who is very, very angry at Danish society.”
The Danish authorities have still not officially named Mr. Hussein as the gunman who killed a Danish film director on Saturday at the cafe and a Jewish security guard at a synagogue later Sunday, wounding five police officers during the onslaught. But Mr. Hussein’s former neighbors, who have had their homes searched by the police, and others who knew the dead suspect, said Mr. Hussein was indeed the man responsible for Denmark’s worst terrorist violence since the 1980s.
“I’m just as shocked as the rest of the world,” his distraught father, a Palestinian from Jordan, told the newspaper Jyllands Posten on Monday, adding that the first he knew of his son’s actions was when the authorities contacted him on Sunday.
“This is not just sad, it is a tragedy,” said Anoir Hassouni, a social worker at a kickboxing club where Mr. Hussein fought and trained for eight months before he was convicted of violent assault in 2013. He was released from prison just two weeks before the weekend attacks.
The city-funded kickboxing club, situated in a former municipal garage covered with graffiti, included many troubled youths from poor or broken homes, Mr. Hassouni said. Some drift into gangs and drugs and get involved in crime, he added, but “they don’t do anything like this.”
Denmark’s prime minister, Helle Thorning-Schmidt, said Monday that investigators so far had “no indication that he was part of a cell” and that the suspect appeared to have acted alone. The authorities say they have no evidence that the suspect ever traveled to Syria or Iraq to wage violent jihad, unlike thousands of other young European Muslims.
Though perhaps not part of an established jihadist network, the young man was clearly not alone in his anger. On Monday, about a dozen young men, their faces covered by scarves, visited the spot where Mr. Hussein died and, declaring themselves his brothers, shouted “Allahu akbar,” or “God is great,” as they removed flowers laid in memorial, a ritual they said was contrary to Islamic teaching.
In place of the flowers, they left a printed leaflet on the ground that fulminated against what they described as Denmark’s double standards, noting that Mr. Hussein’s body had been left in a pool of blood when the body of the Jewish security guard killed at the synagogue had been quickly covered. This, the leaflet said, exposed promises of equality as a fraud and showed that “religion and background make a difference.”
They also taped a sign written in Danish and Arabic to the wall near the spot where Mr. Hussein died: “May God show mercy. Rest in Peace, Captain,” it said, using a gangland title of respect.
Mr. Soei, the sociologist, said he first met Mr. Hussein as part of a group of urban youths during his research for his book, “Angry Young Men.” He said Mr. Hussein was at that time one of the core members of a gang known as the “Brothas,” a group of teenagers with little education, loose contacts to Islam, mostly through their immigrant parents, and big chips on their shoulders against a society from which they felt excluded.
“He was one of the members who seemed to be the most interested and engaged,” Mr. Soei recalled. “He was willing to enter into a dialogue about questions of the gang and their behavior. He wasn’t unintelligent. When he wanted to, he could do a good job in school. But he had an enormous temper he couldn’t control.”
Until his 2013 arrest, Mr. Hussein attended a vocational high school in the town of Hvidovre, near Copenhagen, and was a “good and successful student,” the school’s principal said. Mr. Hussein spent 18 months at the school and “there was nothing to suggest” any shift toward radical Islam.
His temper, however, became so uncontrollable that it unnerved even his fellow gang members, who expelled him from the group. He then stabbed a commuter on a train, for which he was convicted and sent to prison.
Until his incarceration, religion for Mr. Hussein and fellow gang members was not so much a faith, Mr. Soei said, but “part of their identity, part of their narrative of: ‘We are outsiders because of who we are and how we look,’ but they were not praying all the time.”
The Danish newspaper Berlingske reported Monday that, while in prison, Mr. Hussein spoke openly about his wish to travel to Syria to fight with the Islamic State. His remarks, the paper said, led the prison service to put his name on a list among 39 others radicalized in Danish prisons. The prison service declined to comment.
After attacks in Paris last month on the offices of the satirical newspaper Charlie Hebdo and a kosher grocery store, the French authorities have identified prison as a catalyst for radicalism. Two of the three gunmen responsible for those attacks spent time in French prisons, coming into contact with jihadist militants who turned the men’s previously tepid faith in Islam into radical zealotry.
As part of the investigation into the killings in Copenhagen, police officers on Sunday raided an Internet cafe, Power Play Reborn, in the Norrebro district and detained four young men, two of whom are still in detention.
The manager of the cafe, who gave only his first name, Adeel, said the detained men “were just local punks” who spent much of their time “playing shoot’em-up games” on the Internet.
He said he did not know Mr. Hussein, who, according to Danish media reports, visited the Internet cafe on Saturday after the first deadly shooting in the north of the city.
Local gang members, he added, “don’t care about religion. They just want to make money and chill out.”
An earlier version of this article misspelled the town in Denmark where Omar Abdel Hamid El-Hussein attended a vocational school. It is Hvidovre, not Hvidore.