A man was killed and three police wounded when a masked gunman sprayed bullets into a Copenhagen meeting attended by a Swedish artist threatened with death for his cartoons of the Prophet Mohammad.
Prime Minister Helle Thorning-Schmidt said Denmark was on high alert after a "terrorist attack".
Police said it was aimed at artist Lars Vilks, who sparked controversy in 2007 with published drawings depicting the Prophet Mohammad as a dog.
The attacker escaped in a car that was found later in the outskirts of Copenhagen and a manhunt was under way.
A cafe complex was hosting a cultural event called "Art, Blasphemy and Freedom of Expression".
French ambassador Francois Zimeray, who was attending the event, likened the shooting to the attack on the Charlie Hebdo newspaper in Paris by Islamist militants that killed 12 people last month.
"We feel certain now that it was a politically motivated attack, and thereby it was a terrorist attack," Ms Thorning-Schmidt told journalists close to the site of the attack.
European Council President Donald Tusk called the attack "another brutal terrorist attack targeted at our fundamental values and freedoms, including the freedom of expression".
The event's main speaker was Mr Vilks. He and Mr Zimeray were unharmed.
Witnesses said one or more gunmen had tried to shoot their way into the venue before guards returned fire.
"I heard someone firing with automatic weapons and someone shouting. Police returned the fire and I hid behind the bar. It felt surreal, like in a movie," Niels Ivar Larsen told Danish TV2.
The police said at first they were seeking two men who had sped off in a getaway vehicle, but later said they were looking for one man.
They issued a photograph of a suspect wearing a thick coat and maroon bobble hat. His face was obscured by a scarf.
"I'm still a bit stunned. I was inside, I had just sat down after my speech and then I heard shots," Mr Zimeray told French news channel TF1.
"We all dove to the floor as we heard the gunshots and tried to protect ourselves, and we crawled to the emergency exit."
Media reports and witnesses described the attack, saying between 20 and 40 shots were fired from an automatic weapon.
Television footage showed windows of the arts centre and cafe riddled with bullet holes.
"The security guards shouted 'Everyone get out!' and we were being pushed out of the room," Helle Merete Brix, organiser ofthe event, told Reuters.
"They tried to shoot their way into the conference room ... I saw one of them running by, wearing a mask. There was no way to tell his face."
Sound technician Palle Vedel told Danish DR news channel that the meeting had been opened by the French ambassador, who praised Denmark for the support following the Charlie Hebdos hootings.
Denmark itself became a target after the publication 10 years ago of cartoons lampooning the Prophet Mohammad, images which led to sometimes fatal protests in the Muslim world.
"Before the ambassador even got the opportunity to give the floor to Lars Vilks, the meeting was interrupted when one or more men started shooting at the cafe," Vedel said.
Police said the dead civilian man was 40.
Sweden's security police said Swedish bodyguards were with Mr Vilks at the time of the shooting while authorities in southern Sweden said they were helping Danish police.
Sweden is joined to Denmark by bridge and travel across is largely unchecked.
In January, 17 people were killed in France in three days of violence that began when two Islamist gunmen burst into the Paris offices of the satirical weekly Charlie Hebdo, opening fire in revenge for its publication of satirical images of Mohammad.
Mr Vilks stirred controversy in 2007 with published drawings depicting Mohammad as a dog which sparked threats from Islamist militant groups.
He has received numerous death threats and has lived under the constant protection of the Swedish police since 2010.
Two years ago, an American woman known as Jihad Jane was sentenced to 10 years in prison for plotting to kill him.
French President Francois Hollande said Interior Minister Bernard Cazeneuve would go to the Danish capital as soon as possible.