Lars Hedegaard (Scanpix)

A prominent anti-Islam Danish writer and scholar has dodged an assassination bullet outside his Copenhagen home.

Lars Hedegaard, who has strongly criticised lack of press freedom under Islam, was targeted by a gunman in his twenties who rang the doorbell at the writer's home and missed the shot when Hedegaard opened the door.

"When he tried to fire again, the pistol clicked and the assailant ran away," police commissioner Lars-Christian Borg said.

"After a scuffle the attacker fled. At the time of writing we do not know whether the police have apprehended him," the Danish Free Press Society said.

The 70-year-old writer was charged with racism and fined 5,000 kroner ($1,000) in 2011 after he made a series of critical statements about Muslims. He compared Islam to Nazism and claimed that Muslims rape their own children. Hedegaard took the case to the Supreme Court of Denmark and won.

Hedegaard heads both the Free Press Society and the International Free Press Society.

Denmark's Prime Minister Helle Thorning-Schmidt condemned the attack. "It is even worse if the attack is rooted in an attempt to prevent Lars Hedegaard to use his freedom of expression," she told Danish news agency Ritzau.

The writer expressed support for outspoken Islam critics in Europe including Swedish artist Lars Vilks and Dutch lawmaker Geert Wilders.

The Danish police have sealed and cordoned off Copenhagen Zoo after two men wearing ski masks were seen hurling over the wall on the zoo into the hippopotamus enclosure.