One person was shot dead and three police officers were wounded at a freedom of speech debate in Denmark’s capital Copenhagen where the French ambassador was speaking.
Two gunmen are said to be still at large.
Reports say up to 40 shots were fired outside the venue in the Danish capital.
Controversial Swedish cartoonist Lars Vilks, who has drawn caricatures of the Prophet Muhammad, was also present at the blasphemy debate.
Shortly after the attack, a message appeared on the Twitter feed of French ambassador Francois Zimeray saying he was unharmed.
The area around the venue, reportedly a cafe, is under lockdown.
Lars Vilks stoked controversy in 2007 by drawing pictures of the Prophet Muhammad dressed as a dog.
An organizer of the event, Helle Merete Brix, said she clearly considered the incident as an attack on Lars Vilks, reported the Associated Press.
In 2010 two brothers tried to burn down Lars Vilks’ house in southern Sweden and were imprisoned for attempted arson.
A gunman opened fire on September 16 at a court building in Copenhagen, killing one man and seriously wounding another, Danish police said.
One witness told Danish media that five or six shots were fired.
Police said a man had been arrested and a sawn-off shotgun recovered at the scene.
A press release from the police later revealed that two men had been shot near the bailiff’s court on Hestemøllerstræde near Town Hall Square.
Streets surrounding the court have been cordoned off. The motive for the shooting was unclear, police said.
A preliminary hearing was taking place in the court when the firing broke out.
One person has been shot dead and another wounded in a court building in Copenhagen (photo AP)
The police announced that the suspected gunman was in custody and that a sawn-off shotgun had been found.
Jyllands-Posten reports that the police are asking people to stay away from the area and are patrolling in large numbers with machine guns.
A family row may have sparked the attack which took place at about 10:00, Danish media reported.
The head of Copenhagen city court, Soeren Axelsen, said he thought that was the most likely reason for the shooting as the court dealt with family-related cases as well as debts and bankruptcy.
The first victim died at the scene and the second was taken to hospital with life-threatening injuries, Danish TV said.
A witness told reporters that the gunman fled the court and was later arrested in a street beside Copenhagen town hall.
Soeren Axelsen said counselors had been brought to the court to help staff deal with the attack.