The man was shot dead early on Sunday after opening fire on police, officials said, adding that no officers were wounded.
The exchange of fire took place in the multicultural inner-city neighbourhood of Norrebro where police had been keeping an address under observation earlier in the day.
“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 Norrebro station is the person behind the two attacks,” police official Torben Moelgaard Jensen said.
Police said there was no evidence to indicate that any more suspects were involved in the incidents.
Intelligence services, meanwhile, said the attacker could have been inspired by last month’s attacks on the satirical newspaper Charlie Hebdo.
“From the perspective of the Danish Intelligence service, we can’t say anything concrete about the motivation behind the attacks nor the perpetrator’s motives,” Jens Madsen, Danish intelligence service chief.
“But, we are working on the theory that he could have been inspired by the attack in Paris against the Charlie Hebdo newspaper, Islamic extremism and perhaps other attacks in a similar fashion, he added.
Al Jazeera’s Nick Spicer, reporting from Copenhagen said that police have identified the suspect and that it was a man known to Danish intelligence, but have not released any further details.
Police raids were carried out Sunday evening and an arrest was made at an internet cafe in the same neighbourhood the suspected gunman resided, our correspondent added.
Meanwhile, in northern Germany, a police statement said that a carnival parade in Braunscheweig had been called off 90 minutes before it was due to start because of a “specific threat of an Islamist attack”.
Twin attacks
One man was killed and two police officers wounded at the Copenhagen synagogue, while one man was killed and three police officers were wounded in a shooting attack on a cafe in the north of the capital.
Denmark’s Jewish Community identified the victim at the synagogue as 37-year-old Jewish man Dan Uzan, who was guarding a building during a bar mitzvah when he was shot dead at about 1am local time on Sunday morning.
The earlier shooting occurred before 4pm local time on Saturday when police said a gunman used an automatic weapon to shoot through the windows of the Krudttoenden Cafe during a panel discussion on freedom of expression.
The debate on freedom of speech was attended by Lars Vilks, a Swedish artist who had been threatened with death for his cartoons of Prophet Muhammad.
Vilks was whisked away unharmed by his bodyguards but a 55-year-old man attending the event was killed, while three police officers were wounded, authorities said.
Danish Prime Minister Helle Thorning-Schmidt described the two incidents as “terrorist attacks”.
“We don’t know the motive for the attacks but we know that there are forces that want to harm Denmark, that want to crush our freedom of expression, our belief in liberty,” she said in a nationwide address.
“We are not facing a fight between Islam and the West, it is not a fight between Muslims and non-Muslims.”
Al Jazeera’s Christina Marker, reporting from Copenhagen, said the two attacks led to an unprecedented operation in the centre of the capital.
Numerous threats
Krudttoenden Cafe, where the first attack took place, is known for its jazz concerts and was hosting an event titled Art, Blasphemy and the Freedom of Expression when the shots were fired.
The event was organised by Lars Vilks, 68, a Swedish artist who has faced numerous threats for caricaturing Prophet Muhammad in 2007. police confirmed that he was the target of the attack.
Francois Zimeray, the French ambassador to Denmark, was also in attendance when the event came under attack, but was not injured.
Helle Merete Brix, one of the organisers of the free-speech event, told the Associated Press news agency that Vilks was present at the event but not injured.
When Vilks is in Denmark, he receives police protection.
A woman in the US state of Pennsylvania got a 10-year prison term last year for a plot to kill him.
In 2010, two brothers tried to burn down Vilks’ house in southern Sweden and were imprisoned for attempted arson.