Copenhagen police say they killed the man in the Norrebro district after he opened fire on them.
It came after one person was killed and three police officers injured at a free speech debate in a cafe on February 14.
In the second attack, a Jewish man was killed and two police officers wounded near Copenhagen’s main synagogue.
Police say video surveillance suggested the same man carried out both attacks. They do not believe any other people were involved.
“We assume that it’s the same culprit behind both incidents, and we also assume that the culprit that was shot by the police task force… is the person behind both of these assassinations,” Chief Police Inspector Torben Molgaard Jensen told a news conference.
He said police would maintain a high presence in the city.
Early on Sunday, police said they had been keeping an address under observation in the district of Norrebro, waiting for the occupant to return.
When he appeared, he noticed the officers, pulled out a gun and opened fire, police said. They returned fire and shot him dead. The incident happened near Norrebro train station.
Norrebro is a predominantly immigrant district of Copenhagen, about 3 miles away from the synagogue where the shooting took place just hours earlier.
Police earlier warned residents that it was not safe to be in the city centre, although they stressed that there was no curfew in force.
A massive manhunt was launched after the first shooting, which took place during a free speech debate attended by Swedish cartoonist Lars Vilks.
Officials said the gunman made his getaway by car, and a black Volkswagen Polo was later found abandoned a short distance from the scene, police said.
Police released photographs showing the alleged attacker apparently wearing a purple balaclava and thick puffer jacket.
Hours later, a gunman opened fire outside a synagogue in Krystalgade street, about 3 miles from the scene of the first attack.
A Jewish man was fatally shot in the head and two police officers suffered injuries to their arms and legs. The attacker fled.
A Jewish community group later said that the man killed had been on security duty while a confirmation ceremony was taking place inside the synagogue.
PM Helle Thorning-Schmidt had described the first attack as a “politically motivated” act of terrorism.
Cartoonist Lars Vilks, who has faced death threats over his caricatures of the Prophet Muhammad, said he believed he was the intended target of the first attack. He was unhurt.
The French ambassador, Francois Zimeray, was also present during the attack
A description of the debate at the cafe asked whether artists could “dare” to be blasphemous in the wake of attacks by Islamist gunmen in Paris last month against satirical magazine Charlie Hebdo.
In the French attacks, two gunmen opened fire at Charlie Hebdo‘s office, shooting dead 12 people. The next day a suspected accomplice of the militants shot dead a policewoman and later took hostages at a Jewish shop, killing four of them.
Image source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…