Denmark shocked by return of Islamist terrorism after 2005 storm over drawings of the Prophet Muhammad

Danish police admitted yesterday that a Somalian caught breaking into the home of a cartoonist whose work sparked riots across the Muslim world five years ago was a would-be assassin with links to al-Qaida.

The 28-year-old had an axe and a knife when he was shot and wounded by police late on Friday night after cartoonist Kurt Westergaard heard windows being broken and pressed a panic alarm at his house in Aarhus.

News of the attack on Westergaard, 74, who was with his five-year-old granddaughter at the time, shocked many in Denmark who had believed the country's brush with Islamist extremism was consigned to the past.

Westergaard told his employer, the Jyllands-Posten daily, that he had locked himself and the child in the bathroom as the assailant shouted "revenge" and "blood" and tried to smash his way into the house. "My grandchild did fine," he told the newspaper. "It was scary. It was close. Really close. But we did it."

Westergaard has lived amid tight security with a special "safe room" inside his house ever since his caricature of the Prophet Muhammad with a bomb in his turban was first published by Jyllands-Posten in 2005. Islamic law prohibits any depiction of the prophet for fear it would lead to idolatry. The cartoon, one of 12, outraged many Muslims, who make up around 3% of Denmark's 5.5 million population.

It provoked a vigorous debate about free speech then, when other newspapers reprinted the caricatures in 2006 as an act of solidarity with the heavily criticised Jyllands-Posten, it triggered violence in a number of countries.

Three Danish embassies were attacked and at least 50 people died in rioting in the Middle East, Africa and Asia. Several young Muslims have since been convicted in Denmark of planning bomb attacks, partly in protest at the cartoons. In 2008, Osama bin Laden said that Europe would be punished for the cartoons.

The Somalian, who has not been named under Danish privacy laws, was shot in the arm and leg after throwing an axe at an officer and is now in custody charged with the attempted murders of both the policeman and Westergaard.

He had "close ties to the Somali terror organisation al-Shabaab as well as to al-Qaida leaders in East Africa", the Danish security and intelligence service, PET, said in a statement.

Westergaard's attacker, who has a residence permit for Denmark, is also "suspected of being involved in terror-related activities in East Africa", the intelligence statement said.

"PET looks very seriously upon this case, which once again confirms the terror threat directed against Denmark and the cartoonist Kurt Westergaard in particular," said PET chief Jakob Scharf. Investigations are still continuing into whether the man acted alone. Last year, US authorities arrested two men in Chicago suspected of planning attacks on Westergaard and his newspaper.

An umbrella organisation for moderate Muslims condemned the attack. "The Danish Muslim Union strongly distances itself from the attack and any kind of extremism that leads to such acts," the group said in a statement.

Throughout the crisis, the then prime minister, Anders Fogh Rasmussen, distanced himself from the cartoons but resisted calls to apologise for them, citing freedom of speech and saying that the Danish government could not be held responsible for the actions of a free press.