(CNN) - A Somali man believed to have ties to terrorist groups was shot as he allegedly tried to enter the home of Danish political cartoonist Kurt Westergaard -- known for his controversial depictions of the Muslim prophet Mohammed -- on Friday, police said.
The 27-year-old man, who was not identified, wielded an ax and a knife and cracked a window at Westergaard's home in Aarhus, said police spokesman Morten Jensen. A home alarm alerted police to the scene at 10 p.m., and they were attacked by the man, he said.
The officers shot the man in the right leg and left hand. He was hospitalized, but was not seriously injured, police said.
Danish intelligence officials said the suspect is connected to al-Shabaab, al Qaeda's ally in east Africa.
The incident "once again confirms the terrorist threat that is directed against Denmark and against cartoonist Kurt Westergaard, in particular," said Jakob Scharf, spokesman for the Danish Security and Intelligence Service, in a statement.
The suspect was charged at a court hearing Saturday in Aarhus.
Westergaard has received several death threats for depicting the Prophet Muhammad with a bomb-shaped turban.
Once again, who is vetting these animals before allowing them to enter the country?
Authorities did not identify the suspect because the judge decided it would be illegal to disclose his name, said Madsen, with the East Jutland Police.
Authorities said he was a 28-year-old Somali who has legal residency in Denmark and lives in Sjaelland, near Copenhagen.
For the love of Mike, it is harder to smuggle a parrot into western countries than it is for a terrorist to obtain residence.