Police believe the man they shot dead at a Copenhagen train station had carried out two fatal attacks hours earlier in the city.
Danish officers said they had killed the man after he opened fire on them at Norrebro Station.
They think he was responsible for an attack at a cafe on Saturday afternoon and another at a synagogue overnight that happened just two miles apart.
There is nothing to suggest there were other gunmen involving in the shootings that left two people dead and five police officers wounded, according to Investigator Joergen Skov.
The attack at the city’s main synagogue in Krystalgade just after midnight UK time saw one man die after being shot in the head and two policemen also shot, one in the arm and the other in the leg.
A major manhunt was already underway after an earlier attack, in which one man was killed and three police officers injured when a gunman opened fire at a cafe where a meeting on free speech was taking place .
The chairman of the Nordic Jewish Security Council, Michael Gelvan, told AFP news agency that the man shot dead at the synagogue was Jewish.
He described the victim as a “young man”, who he said had been responsible for “access control” at the place of worship.
Police had earlier said the gunman responsible for the synagogue attack fled on foot, and urged people in the centre of the city to remain indoors.
Sky News cameraman Pete Milnes, who was in a hotel next to the synagogue when the shootings took place, said: “There was a succession of about six or seven gunshots.
“Within a minute or so, armed police were on the scene, a helicopter was hovering overhead. I witnessed police apprehend an individual who was handcuffed and later released.
“There was 20 to 30 armed police officers with semi-automatic rifles shouting at locals to stay indoors and close windows.”
He said the scene was now calmer.
“There’s probably a dozen or so armed officers and a few detectives with sniffer dogs who seem to be combing the area … and lifting drain covers,” he said.
“Now they’re just sealing off the area.”
The earlier attack took place at a cafe hosting a debate on freedom of speech attended by Swedish artist Lars Vilks, who has been threatened with death for his cartoons of the Prophet Mohammed.
A 40-year-old man died in the attack at Krudttoenden cafe, which took place shortly before 3pm UK time on Saturday – and police said a suspect was still at large.
Around 30 bullet holes were seen in the windows of cafe in the north of the city after the attack and at least two people were seen being taken away on stretchers, TV2 said.
Witnesses said police returned fire after someone shouted and opened fire.