Danish authorities have charged a Somali man with two counts of attempted murder for Friday's attack on cartoonist Kurt Westergaard, whose depiction of the Prophet Muhammad angered the Muslim world in 2005.

The 28-year-old suspect with alleged links to terrorist groups al-Shabab and al-Qaida was was rolled into a Danish court on a stretcher Saturday, and was charged with the attempted murder of the cartoonist and a policeman. He denied the charges.

Denmark's police say the man, armed with a knife and an ax, broke into Westergaard's home near the town of Aarhus, about 200 kilometers northwest of the capital Copenhagen.

The 74-year-old cartoonist fled with his granddaughter to a special safe room in the house, where he could call police. He said the attacker screamed, "revenge" and "blood" as he smashed in the front door with the ax.

The local deputy chief superintendent, Fritz Keldsen, said police officers who arrived on the scene shot the suspect in the hand and the hip after he attacked a police patrol. The official said the suspect's wounds are not life-threatening.

Officials said Westergaard has been moved to an undisclosed location for his protection.

The Associated Press reported that a moderate Muslim organization in Denmark, the Danish Muslim Union, condemned the attack in statement Saturday.

Westergaard's controversial cartoons, depicting the Prophet Muhammad with a bomb-shaped turban, ignited riots and sparked outrage among Muslims worldwide in 2005. He has received several death threats since then.