(CNN) -- The attack on a Danish political cartoonist "runs totally against the teachings and values of Islam," the umbrella organization representing Muslim countries has said.
If the attack was a reaction to Kurt Westergaard's drawing of the Muslim prophet Mohammed with a turban shaped as a bomb, "then it should be rejected and condemned by all Muslims," the Organization of the Islamic Conference said in a statement Sunday.
An ax-wielding Somali man is accused of trying to break into Westergaard's home Friday and was charged the next day with attempted assassination. Intelligence officials linked the suspect to an East African Islamist militia allied with al Qaeda.
The suspect tried to kill Westergaard and an on-duty police officer, the Danish Intelligence and Security Service said.
Danish police shot the 28-year-old suspect Friday night as he tried to enter Westergaard's home in the city of Aarhus.
The suspect was shot in the right leg and left hand. He was hospitalized after the incident. Video showed him appearing at court strapped to a stretcher.
Authorities did not identify him because the judge decided it would be illegal to disclose his name, said Chief Superintendent Ole Madsen with the East Jutland Police. They said he has legal residency in Denmark and lives in Sjaelland, near Copenhagen.
The judge ordered the suspect held for four weeks while the investigation proceeds. Madsen said the man is currently the only suspect in the case, and he would not say whether police were investigating anyone else.
Al-Shabaab, the militant organization with alleged ties to the suspect, is waging a bloody battle against Somalia's transitional government and is currently on a U.S. government list of terrorist organizations.
At a news conference in the Somali capital of Mogadishu, al-Shabaab spokesman Sheikh Ali Mohamud Rage said, "We are very happy with the Somali national who attacked the house of the Danish cartoonist who previously insulted our prophet Mohammed. This is an honor for the Somali people. We are telling that we are glad that anyone who insults Islam should be attacked wherever they are."
Police had no indication that an attack was being planned on Westergaard, Madsen said, though the intelligence service said the suspect had been under surveillance because of his alleged terrorist links.
Police said the suspect wielded an ax and a knife and managed to crack the glass front door of Westergaard's home. A home alarm alerted police to the scene, and they were attacked by the suspect, authorities said.
Westergaard, who was home with his 5-year-old granddaughter at the time of the break-in, hid in a "panic room" when he realized what was happening, Madsen said. Westergaard is ordinarily accompanied by bodyguards when he leaves his home, but nobody was on guard at the house Friday, the Security and Intelligence Service told CNN.
Police said Westergaard was "being taken care of" after the break-in, but wouldn't reveal his new location.
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.
Westergaard's caricature of Mohammed -- showing the prophet wearing a bomb as a turban with a lit fuse -- was first published by the Danish newspaper Morgenavisen Jyllands-Posten in September 2005. It sparked an uproar among Muslims in early 2006 after newspapers reprinted the images in support of free speech.
At the time, Westergaard said he wanted his cartoon to say that some people exploited the prophet to legitimize terrorism. However, many in the Muslim world interpreted the drawing as depicting their prophet as a terrorist.
Over the years, Danish authorities have arrested other suspects who allegedly plotted against Westergaard's life.
After three such arrests in February 2008, Westergaard issued a statement, saying, "Of course I fear for my life after the Danish Security and Intelligence Service informed me of the concrete plans of certain people to kill me. However, I have turned fear into anger and indignation. It has made me angry that a perfectly normal everyday activity which I used to do by the thousand was abused to set off such madness."
Scharf said authorities have taken measures to ensure Westergaard's safety, and that the protection has "proven effective."
-- CNN's Per Nyberg and reporter Mohamed Amiin Adow contributed to this report.