A Somalian man has appeared in court on two charges of attempted murder after he allegedly tried to enter the home of a cartoonist who outraged many Muslims with his depiction of the Prophet Mohammed.

Kurt Westergaard (74), took refuge in a safe room in his Aarhus home after alerting police to an attempted break-in by the man who, police said, was carrying an axe and a knife.

Westergaard angered many Muslims with his work depicting Islam’s founding prophet.

His 2005 opus, one of 12 for the Jyllands-Posten newspaper, linked Mohammed with violence while all depictions of the prophet are generally forbidden by Islamic law.

The 28-year-old suspect was in hospital being treated for injuries to the knee and a hand after he was shot by police but his life is not thought to be in danger.

Jakob Scharf, head of Denmark’s PET intelligence service, said the man would be charged with attempted murder for trying to kill Westergaard and a police officer.

Police arrived two minutes after Westergaard’s call and the assailant wielded an axe at an officer who then shot the man, police said.

Westergaard’s home has protective features including the safe room and an alarm button while the area surrounding his house is frequently patrolled by police.

A five-year-old grandchild had been staying with Westergaard who said he was shocked after the alleged foiled attempt to kill him.

“It was close,” he told the Jyllands-Posten website. “It was really close. But we did it. That’s good, very good.”

PET said in a statement that the arrested man had links with Somali terror group al Shabaab and al Qaida leaders in East Africa.

He had a Danish residence permit and, according to Westergaard’s remarks to Jyllands-Posten, had shouted “blood” and “revenge” during the incident.

It is not the first time that Westergaard has been the target of an apparent plot to kill him.

Last October two Chicago men were charged with terror offences related to an alleged plot to kill Westergaard and the newspaper’s former cultural editor.

In 2008, Danish police arrested two Tunisian men suspected of planning to kill Westergaard. Neither suspect was prosecuted and one has since been deported.

The cartoons caused an outcry in Muslim countries and prompted demonstrations at Danish diplomatic outposts around the world, including London.

Denmark’s government, while distancing itself from the content of the cartoons, refused to condemn the decision to publish them, citing the right to free speech.

PA