Police shot dead a 22-year-old Danish-born gunman on Sunday after he killed two people at a Copenhagen synagogue and an event promoting free speech in actions possibly inspired by an attack on the French satirical weekly Charlie Hebdo, authorities said.
Spy chief Jens Madsen said the gunman was known to intelligence services prior to the shooting and had probably acted alone. Police said he had a record of violence, gang-related activities and weapons possession.
Two civilians - a synagogue guard and a film-maker - were killed and five police were wounded in the two separate attacks in the Danish capital on Saturday and Sunday.
Witnesses said the gunman had fired up to 40 shots at a cafe hosting a free speech event with Swedish artist Lars Vilks, who has received death threats for depicting the head of the Prophet Mohammad on a dog.
The gunman then moved on to a nearby synagogue where the guard, protecting a young girl's confirmation, was gunned down.
On Sunday, thousands of Danes left a sea of flowers by the city's ornate 180-year-old synagogue.