Police in Copenhagen say they have shot and killed a man who shot at them near a train station and are investigating whether he is linked to two shootings hours earlier at a free speech event and near a synagogue.

"The man was hailed. He opened fire against the police and was then shot to death. The man has died. No police officers were hit," the police said in a statement of the incident in the Norrebro area of the city.

The statement says the shooting occurred after they had put an address near the train station under observation.

The incident followed a nightmarish day in the Danish capital, which began with the attack on a free speech event featuring an artist who had caricatured the Prophet Muhammad, and a second shooting hours later outside a synagogue.

Police couldn't say whether the shootings at a cultural centre Saturday afternoon and in front of the synagogue early Sunday were connected, but didn't rule it out. In both shootings, the gunman got away.

The attacks stirred fears that another terror rampage was under way in a European capital a month after 17 people were killed in Paris attacks.

"I was on my bed and I heard gunshots, and my heart raced. - Sebastian Zepeda, visitor

Sebastian Zepeda, a visitor from London, said he didn't want to leave his hotel room after hearing of the first shooting, and was text messaging with his mother when the second shooting happened on the street below.

"I was on my bed and I heard gunshots, and my heart raced," Zepeda said. "All of a sudden the road was packed with police."

The earlier shooting came a month after extremists killed 12 people at a satirical newspaper in Paris that had sparked Muslim outrage with its depictions of Muhammad. Another five people were killed at a kosher delicatessen the same day, including the jihadist attacker.

Denmark on high alert

There was no immediate claim of responsibility for the first shooting, which took place shortly before 4 p.m. on Saturday. Danish police said the gunman used an automatic weapon to shoot through the windows of the Krudttoenden cultural centre and café, which TV footage showed were riddled with bullet holes. The gunman then fled in a carjacked Volkswagen Polo that was found later a few kilometres away, police said.

Swedish artist Lars Vilks has faced numerous threats for caricaturing the Prophet Muhammad. (The Associated Press) Prime Minister Helle Thorning-Schmidt said Denmark was on high alert after the "terrorist attack" that police said had been aimed at Vilks.

"We feel certain now that it was a politically motivated attack, and thereby it was a terrorist attack," the prime minister told reporters close to the site where a person was killed and three policemen were wounded. "We are on high alert all over the country."

Police have not identified the the man slain at the cultural centre. Two of the wounded officers belonged to the Danish security service PET.

Lars Vilks, a Swedish artist who has faced numerous death threats for caricaturing the Prophet Muhammad, was one of the main speakers at Saturday's panel discussion, titled "Art, blasphemy and freedom of expression." He was whisked away by his bodyguards unharmed as the shooting began.

`What other motive could there be?'

Vilks, 68, later told The Associated Press he believed he was the intended target of the shooting.

"What other motive could there be? It's possible it was inspired by Charlie Hebdo," he said, referring to the Jan. 7 attack by Islamic extremists on the French newspaper in Paris. He spoke from an undisclosed location for his own security.

"I saw a masked man running past," said Helle Merete Brix, one of the event's organizers. "I clearly consider this as an attack on Lars Vilks."

She and Vilks were quickly ushered away by the security detail that accompanies the artist whenever he is in Denmark.

"At first there was panic. People crawled down under tables," Vilks said. "My bodyguards quickly pulled me away."

The artist said no one inside the lecture hall was wounded.

I'm not shaken at all by this incident. Not the least. - Lars Vilks

"We were well isolated in there. It would have been much worse if this happened during the break, when people walk out," Vilks said.

He said he deplored the death and the injuries but was unfazed as to what it meant for his own safety.

"I'm not shaken at all by this incident. Not the least," he told AP by phone. He declined to reveal his location for security reasons.

Copenhagen police's photo is believed to show the suspect in a shooting at a freedom-of-speech event in Copenhagen on Saturday. One person died in the shooting deemed a 'terrorist attack' by the country's leader. (Associated Press)

François Zimeray, the French ambassador to Denmark who was at the event to speak about the Charlie Hebdo attack, tweeted that he was "still alive." Police said he was not wounded.

French President François Hollande called the Copenhagen shooting "deplorable" and said Thorning-Schmidt would have the "full solidarity of France in this trial." French Interior Minister Bernard Cazeneuve was travelling to Copenhagen as soon as possible, Hollande said in the statement.

In California, a member of President Barack Obama's cabinet denounced the attacks. National Security Council spokeswoman Bernadette Meehan said U.S. officials are ready to help with the investigation and have been in touch with their Danish counterparts.

Sweden's security service said they were sharing information about the case with their Danish counterparts but declined to give details.

Forensic investigators were at the scene of the shooting at a Danish cultural centre-café that left a civilian dead and three police wounded. The event featured Lars Vilks, an artist who has received death threats since publishing images of the Prophet Mohammad. (Martin Sylvest/Reuters)

Vilks has faced several attempted attacks and death threats after he depicted the Prophet Muhammad as a dog in 2007.

A Pennsylvania woman last year got a 10-year prison term for a plot to kill Vilks. In 2010, two brothers tried to burn down his house in southern Sweden and were imprisoned for attempted arson.

Vilks told The Associated Press after the Paris terror attacks that, due to increased security concerns, even fewer organizations were inviting him to give lectures.

"This will create fear among people on a whole different level than we're used to," he said. "Charlie Hebdo was a small oasis. Not many dared do what they did."

The depiction of the prophet is deemed insulting to many followers of Islam. According to mainstream Islamic tradition, any physical depiction of the Prophet Muhammad — even a respectful one — is considered blasphemous.