The gunman believed to have attacked a free-speech debate and a Copenhagen synagogue was 22, born in Denmark and known to them because of past violence, police say.
The presumed gunman was shot and killed early on Sunday morning by police who were monitoring an address in the Norrebro district of the city.
The man’s name has not been confirmed.
A film director and a synagogue guard were killed in separate attacks. Five police officers were also injured.
Police believe the gunman was acting alone.
He was known to them in connection with criminal gangs and had convictions for violent offences and dealing in weapons.
“It was the case that when the suspect was shot and killed during police action, he was armed with pistols,” police commissioner Thorkild Fogde told a news conference.
Danish media have widely named him as Omar El-Hussein, but police did not release the suspect’s identity.
The attacks began on Saturday, February 14, when the gunman fired shots at a cafe hosting a seminar on free speech. It was attended by cartoonist Lars Vilks, who has faced death threats over his caricatures of the Prophet Muhammad.
The gunman opened fire again in the early hours of Sunday outside a synagogue in Copenhagen.
The Danish intelligence service is investigating whether the gunman was copying the shootings in Paris last month, when 17 people were killed in attacks on the satirical magazine Charlie Hebdo and HyperCacher kosher supermarket.
Earlier, the head of the intelligence service told reporters the man had been known to them, and police were working to determine whether he had travelled to Syria or Iraq.
PM Helle Thorning-Schmidt described the shootings as “a cynical act of terror against Denmark” and said her government would not compromise on its defense of free expression.
Helle Thorning-Schmidt later visited the synagogue and said Denmark would do everything to protect its Jewish community.
Denmark prides itself on being one of the few European countries to have saved most of its Jewish population from the Nazi Holocaust in the 1940s.
“When you mercilessly fire deadly bullets at innocent people taking part in a debate, when you attack the Jewish community, you attack our democracy,” Helle Thorning-Schmidt said on a visit to the synagogue on February 15.
“We will do everything possible to protect our Jewish community.”
Israeli PM Benjamin Netanyahu has urged Danish Jews to emigrate to Israel. Denmark’s Chief Rabbi Jair Melchior said he was “disappointed” by Benjamin Netanyahu’s stance, the AP reported.
“If the way we deal with terror is to run somewhere else, we should all run to a deserted island,” said Jair Melchior, according to AP.
There has been widespread international condemnation. The US State Department tweeted: “We stand with the people of Denmark and all who defend the universal right of freedom of speech and stand against anti-Semitism and bigotry.”
Patrick Pelloux, a Charlie Hebdo columnist, said: “We are all Danish tonight.”