COPENHAGEN, Denmark -- A shooting at a free speech event featuring an artist who had caricatured the Prophet Muhammad and a second shooting hours later outside a synagogue left two dead and five police officers wounded in Copenhagen, stirring fears that another terror spree was underway in a European capital a month after 17 people were killed in Paris attacks.

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.

"We are looking for two perpetrators," police spokesman Allan Wadsworth-Hansen told reporters.

Two hours later, police announced they had shot and killed a man who shot at them near a train station and were investigating whether he could be linked to the two shootings. The police statement posted online says the shooting occurred after they had put an address near the train station under observation. The statement said no police officers were wounded.

The first shooting happened shortly before 4 p.m. Saturday. Danish police said the gunman used an automatic weapon to shoot through the windows of the Krudttoenden cultural centre during a panel discussion on freedom of expression following the Paris attacks. A 55-year-old man attending the event was killed, while three police officers were wounded. Two belonged to the Danish security service PET, which said the circumstances surrounding the shooting "indicate that we are talking about a terror attack."

The gunman then fled in a carjacked Volkswagen Polo that was found later a few kilometers (miles) away, police said.

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

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 that had angered Muslims by lampooning Muhammad.

Police spokesman Joergen Skov said it was possible the gunman had planned the "same scenario" as in the Charlie Hebdo massacre.

After searching for the first gunman for hours, police reported the second shooting in downtown Copenhagen after midnight Sunday. Wadsworth-Hansen said that gunman opened fire at two police officers outside the synagogue. They were wounded in the arms and legs but were not in life-threatening condition, while a civilian man was killed. The gunman fled on foot.

Sebastian Zepeda, a 19-year-old 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."

Witnesses in a bar across the street from the synagogue said they saw special police teams moving in with automatic rifles.

"We looked out the window and saw this guy lying on the street," said Rasmus Thau Riddersholm, 33. "We were told by police to stay in the back of the room, away from the windows and doors."

Police initially said there were two gunmen at the cultural centre but later said they believed there was only one shooter. They described him as 25 to 30 years old with an athletic build and carrying a black automatic weapon. They released a blurred photograph of the suspect wearing dark clothes and a scarf covering part of his face.

"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."

Niels Ivar Larsen, one of the speakers at the event, told the TV2 channel he heard someone shouting and firing automatic weapons. "Police returned the fire and I hid behind the bar. I felt surreal, like in a movie," Larsen said.

Visiting the scene of the first shooting, Danish Prime Minister Helle Thorning-Schmidt called it a "political attack and therefore an act of terror."

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 Francois 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 arriving Sunday in Copenhagen.

Leaders across Europe condemned the violence and expressed support for Denmark. Sweden's security service said it was sharing information with its Danish counterpart, while U.S. National Security Council spokeswoman Bernadette Meehan said U.S. officials were ready to help with the investigation and have been in touch with their Danish counterparts.

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 AP after the Paris terror attacks that, due to increased security concerns, even fewer organizations were inviting him to give lectures.

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.

While many Muslims have expressed disgust at the deadly assault on the Charlie Hebdo employees, many were also deeply offended by its cartoons lampooning Muhammad.