Saturday's twin attacks on a cultural centre and synagogue in Copenhagen left two people dead and five police officers wounded before the assailant himself was gunned down.
Following is a timeline of the dramatic events, which lasted nearly 14 hours from the first burst of gunfire to the last.
In the first attack at around 3:30 pm (1430 GMT), a man armed with a machine pistol fires dozens of rounds on the cultural centre where a forum on Islam and free speech is taking place attended by dozens of people.
Swedish cartoonist Lars Vilks, survivor of several death threats since gaining international notoriety for a 2007 cartoon portraying the Prophet Mohammed as a dog, is a speaker at the forum titled "Art, Blasphemy and Freedom".
His presence requires police protection.
The assailant's barrage of gunfire is caught on a recording broadcast by the BBC.
France's ambassador to Denmark, Francois Zimeray is at the event, having been invited little more than a month after the attacks in Paris that left 12 people dead at the satirical weekly Charlie Hebdo, followed by the killing of a policewoman, and four Jewish shoppers at a kosher supermarket.
Speaking to AFP by telephone from the cultural centre, Zimeray recounts how all the participants threw themselves to the floor as soon as the gunfire erupted.
"Intuitively I would say there were at least 50 gunshots, and the police here are saying 200. Bullets went through the doors," he says.
Still alive in the room— Frankrigs ambassadør (@francedk) February 14, 2015
A 55-year-old participant is killed and three police officers are wounded. Danish media identify the dead man as documentary filmmaker Finn Norgaard.
The gunman flees the scene in a Volkswagen Polo, sparking a manhunt.
'Gunman acted alone'
At first investigators think two men are involved including one in the getaway car, but after gathering eyewitness accounts they conclude that the gunman acted alone.
He abandons the car some two kilometres (a little more than a mile) to the north of the cultural centre, near a railway station.
At 5:07 pm, police release the car's licence plate number and warn Copenhagen residents against trying to apprehend the suspect.
At 5:45 pm police say they have found the abandoned car.
At 7:23 pm police issue a description of the suspect as being "between 25 and 30 years old, around 1.85m (six foot one inch) tall, athletic, of Arab appearance but with lighter skin than normal and with black, slick hair."
At 8:06 pm police release a still from video surveillance footage taken outside the railway station showing him wearing a dark anorak and a maroon balaclava carrying a black bag:
The second shooting takes place between midnight and 1am Sunday outside Copenhagen's main synagogue.
A spokesman for a Jewish association, Jeppe Jul, tells Swedish daily Dagens Nyheter that the assailant looks like a drunken partygoer, saying he vomited in the street.
The gunman opens fire without warning, wounding two police officers and killing a 37-year-old Jewish man, Dan Uzan, a guard at the synagogue. The gunman flees on foot.
At around 4am, police receive a call from a taxi driver who thinks he spotted the fugitive.
Security forces stake out a building in the working-class neighbourhood of Nørrebro.
At around 5am the man arrives and fires on police, who return fire, killing him.
Early Sunday, investigators say they believe the man was behind both attacks. Police add that the attack may have been inspired by the Paris attacks and that the man was "on the radar" of authorities prior to carrying out the deadly shootings.
Police go on to launch several raids, including one on an Internet cafe in Copenhagen.
Police say the suspect was a 22-year-old man born and raised in Denmark who had a history of assault and weapons offences.
Several media outlets name him as Omar El-Hussein. Danish tabloid Ekstra-Bladet says he was released from jail two weeks ago after serving a term for aggravated assault.
Police said they are investigating if the man had received help from others and the possibility he had travelled to conflict zones such as Syria and Iraq.