Police in Copenhagen say they have shot dead a man they believe was behind two deadly attacks in the Danish capital hours earlier.
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 Saturday.
In the second attack, a Jewish man was killed and two police officers wounded near the city's main synagogue.
Police say video surveillance suggested the same man carried out both attacks. They do not believe any other people were involved.
The head of Danish intelligence said investigators were working on the theory that the gunman could have been inspired by the shootings in Paris last month. The attacks on the Charlie Hebdo magazine, a kosher supermarket and a policewoman claimed 17 lives.
Jens Madsen told reporters the man had been identified and had been on the agency's radar for some time.
Police were working to determine whether the man had travelled to Syria or Iraq, he said.
Prime Minister Helle Thorning-Schmidt said it was "a very sad morning" and described the shootings as "a cynical act of terror against Denmark".
She later visited the synagogue and said Denmark would do everything to protect its Jewish community.
Early on Sunday, police said they had been keeping a property under observation in the district of Norrebro, waiting for the occupant to return.
The address, near Norrebro train station, had been identified using information from a taxi driver who dropped the suspect there following the first attack on Saturday.
When the man appeared, he saw the officers, pulled out a gun and opened fire, police said. They returned fire and shot him dead.
A manhunt had been launched after the first shooting, which took place during a free speech debate at the Krudttonden cultural centre hosted by controversial Swedish cartoonist Lars Vilks.
A man attending the event, named by Danish broadcaster DR as film director Finn Norgaard, 55, was killed and three police officers wounded.
Officials said the gunman fled by car, and a black Volkswagen Polo was later found abandoned a short distance from the scene. Police said the gunman then called a taxi to take him home.
Credit : BBC