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 yesterday attended by the Swedish cartoonist behind controversial caricatures of the Prophet Mohammed.
"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 yesterday.
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.
