Omar El-Hussein, the Dane of Palestinian origin named in the media as the perpetrator of two deadly shootings in Copenhagen at the weekend, had several brushes with the law before attacking a cultural centre and a synagogue.
On Monday, locals were struggling to comprehend how a young man born in their midst could turn into a cold-blooded killer, and investigators wanted to know how a man released from jail just two weeks earlier could apparently go on a murderous rampage through the capital.
People who knew 22-year-old El-Hussein, including a former classmate who talked to the news agency AFP, described him as smart and helpful but that he also had a darker side.
Former classmates said he had an aggressive disposition that may have been worsened by drug abuse.
"He sometimes behaved pretty aggressively but otherwise he was nice and very smart. He had good grades at school, he had friends and he was a good classmate," Julie, a former schoolmate who asked for her surname to be kept secret, told AFP.
El-Hussein was born in Copenhagen to Palestinian parents who fled to Denmark via a refugee camp in Jordan, according to Politiken. His Middle East background appears to have shaped his views in profound ways.
"He loved to discuss Islam. In particular, he often discussed Israel and the Palestine conflict. He wasn't afraid of saying openly that he hated Jews," a former classmate told Ekstra Bladet.
Still, few who knew him seemed capable of linking the man of their recollections with the person who shot and killed two people — one at a debate on Islam and free speech, the other at Copenhagen's main synagogue — before himself being killed by police in a pre-dawn shootout.
Julie, the former classmate, recalled how El-Hussein had rushed to help her when she was hit by a car outside their school in 2013.
Yet days later, he stabbed a 19-year-old man in the leg on board a commuter train in Copenhagen.
"At first I considered him to be a good person with a good heart because he had helped me," Julie told AFP. "And then I heard that he had hurt someone — and now this. It's unbelievable."
El-Hussein was sentenced to two years in prison for the stabbing. He was released at the start of this year, a mere fortnight before the deadly shootings.
Danish media reported he was capable of getting good grades in school when he put his mind to it and was a Thai kick-boxing aficionado.
However, he "ended up in bad company, really bad," an acquaintance told Politiken, adding that he also became a heavy user of cannabis. "He wound up in a trap."
According to police officials, who have still not identified the suspected gunman by name, he had a history of assault and violating regulations on the possession of weapons.
It was while in prison that he expressed a desire to travel to Syria to wage jihad, Berlingske reported.
Danish intelligence boss Jens Madsen has admitted El-Hussein was "on the radar" of his service.
Hans Brun, a terrorism researcher at King's College in London, told AFP that El-Hussein had "a fairly typical profile" of an extremist.
"He led a troubled life but was never accepted into the top levels of organised crime. He was in and out of jail but never qualified for the big boys."
Brun said that irrespective of whether he had been planning to wage jihad in Syria, the suspect had the hallmarks of a homegrown terrorist.
"Trips abroad are not a pre-condition for someone to become dangerous. One can very well be radicalised in quiet at home. Breivik [the Norwegian extreme-right mass-murderer] was. He was one of us," said Brun.
Swedish artist Lars Vilks, who is the presumed target of the first attack at a cultural event in Copenhagen has been sent into hiding since the shootings.
Vilks – who has already faced several death threats since his cartoon portraying the Prophet Mohammed as a dog was published in a Swedish newspaper in 2007 – already lives under constant police protection.
But police spokeswoman Ewa-Gun Westford said that Vilks' home in Höganaes, southern Sweden, "is not a safe place. And he needs to be in a safe place".