Danish police say they have shot and wounded a Somali man who attempted to enter the home of cartoonist Kurt Westergaard, whose controversial 2005 caricatures of the Prophet Muhammad sparked riots across the Muslim world.

The head of the Danish Security and Intelligence Service, Jakob Scharf, said in a statement early Saturday that the 28-year-old intruder, armed with an ax and a knife, has close ties to the Somali terrorist group al-Shabaab, as well as al-Qaida leaders in eastern Africa.

The suspect, who failed to enter Westergaard's home in Viby near the western city of Aarhus, was wounded and is now in police custody.  Westergaard was not injured.

The cartoonist told the Danish newspaper Jyllands-Posten that he locked himself in a specially made safe area he calls the "panic room" from where he could call police who are stationed nearby.

Westergaard is one of 12 Danish cartoonists whose drawings of the Muslim prophet were first published by Jyllands-Posten in September 2005, triggering reprisals leading to dozens of deaths.

Security Service chief Jakob Scharf said Westergaard's attacker, who has a legal Danish residence permit, will be charged with attempted murder for trying to kill the 74-year-old cartoonist and a police officer.

Scharf said the suspect had been under surveillance in Denmark and is suspected of having been involved in terror-related activities during a stay in east Africa.

Westergaard's caricatures, including one depicting Muhammad wearing a bomb-shaped turban, are considered offensive by many Muslims.  Their publication spurred riots and attacks on Danish embassies in several Muslim countries in 2006.

In March 2008, Denmark's three main newspapers republished Westergaard's controversial drawing after three people were arrested for plotting his murder.

Some information for this report provided by AP, AFP and Reuters.