Copenhagen police said Sunday they believe a man shot dead by officers was responsible for two fatal attacks that shocked the normally peaceful Danish capital.
The killings, coming little more than a month after bloody Islamist attacks in Paris that left 17 people dead, were described by Danish Prime Minister Helle Thorning-Schmidt as "a cynical act of terror".
The man believed to be behind the shootings was shot dead after he opened fire on police at a rail station, a spokesman said.
It came after a 55-year-old man was killed at a panel discussion about Islam and free speech on Saturday attended by the Swedish cartoonist behind controversial caricatures of the Prophet Mohammed.
In the second attack, a Jewish man was killed and two police officers were wounded outside Copenhagen's main synagogue early Sunday.
"We believe the same man was behind both shootings and we also believe that the perpetrator who was shot by the police action force at Noerrebro station is the person behind the two attacks," Torben Moelgaard Jensen told a press conference.
The first lethal attacks on Danish soil in decades were branded "deplorable" by the United States and triggered condemnation around the world.
Lars Vilks, whose controversial cartoons of the Prophet Mohammed sparked worldwide protests in 2007, had been among the speakers at the Krudttoenden cultural centre when a man opened fire Saturday.
A man was killed when the gunman sprayed bullets at the centre, while a young Jewish man was gunned down outside the synagogue in central Copenhagen. Five police officers were wounded in the two attacks.
The killing of the suspected perpetrator capped a massive police manhunt launched after the gunman fled the scene following both shootings.
The shootout took place shortly before dawn in the inner-city neighbourhood of Noerrebro, where police had been keeping an address under observation.
Police said video surveillance had led to them to believe that the man killed by law enforcers was behind both attacks, but that a large amount of considerable investigative work would be required to ascertain that he was not acting with others.
Night of fear
The shooting came at the end of a night of fear that had gripped the city of about one million, which had been spared major attacks in recent years.
The central area of Copenhagen that is home to both the synagogue and Noerreport station, the country's busiest rail hub, was cordoned off by police carrying machine guns.
Swedish security services told AFP they were on alert for any attempt by a suspect to cross the bridge linking Denmark with Sweden.
Michael Gelvan, chairman of the Nordic Jewish Security Council, told AFP the victim at the synagogue was a young Jewish man who had been providing security for a ceremony.
Danish police had released a photo of the suspect in the cultural centre attack, wearing a black puffer jacket and a maroon balaclava and carrying a black bag.
Police said the gunman who fled the scene of the second shooting had been wearing black trousers, black shoes and a light grey jacket with "multi-coloured" parts.
Spectre of Charlie Hebdo attack
The windows of the cultural centre were pockmarked by bullet holes, and the BBC released chilling audio of the moment a speaker at the event was interrupted by a volley of gunshots.
France's ambassador to Denmark Francois Zimeray, who was present at the debate but was unhurt, told AFP the shooting was an attempt to replicate the January 7 attack on the Charlie Hebdo satirical magazine in Paris which killed 12 people.
"They shot from the outside (and) had the same intention as Charlie Hebdo, only they didn't manage to get in," he said.
"Intuitively I would say there were at least 50 gunshots, and the police here are saying 200," he said.
"Bullets went through the doors and everyone threw themselves to the floor."
Charlie Hebdo has, like Vilks, angered Islamist extremists by publishing cartoons mocking the Prophet Mohammed and frequently satirises Islam.
'We're all Danish tonight'
Police initially said two suspects had fled the cultural centre in a Volkswagen Polo. The car was found abandoned around two hours after the attack.
Before the presumed attacker was shot dead, the Danish premier said: "Everything leads us to believe that the shooting was a political attack and therefore a terrorist act."
The shootings come at a time of heightened security and rising fears of Islamist violence in Europe.
Dozens of suspected jihadists have been arrested across Europe since mid-January and stocks of weapons and explosives have been uncovered.
Vilks has been living under police protection after his controversial cartoons prompted death threats.
Charlie Hebdo columnist Patrick Pelloux voiced dismay over the attack at the debate Vilks had been attending, saying: "We are all Danish tonight."
He urged artists not to succumb to self-censorship out of fear, telling AFP: "We must stand firm and not be afraid."