Kurt Westergaard has had a price on his head since 2006
Danish police have shot and wounded a man at the home of Kurt Westergaard, whose cartoon depicting the Prophet Muhammad sparked an international row.
Mr Westergaard scrambled into a panic room at his home in Aarhus after a man wielding an axe and a knife broke in.
Danish officials said the intruder was a 28-year-old Somali, who they did not name, but said was linked to the radical Islamist al-Shabab militia.
The cartoon, printed in 2005, prompted violent protests the following year.
By Malcolm Brabant, BBC News
This attack will force the Danish secret service Pet to review their protection.
Mr Westergaard's house was supposed to have been turned into a fortress, with blast proof windows, and yet a determined individual came within a whisker of killing him.
Moderate Muslims in Denmark have condemned the attack on Kurt Westergaard, but they still believe his drawing was sacrilegious.
Muslim nations are attempting to outlaw what they call the defamation of their religion.
Mr Westergaard came out of hiding last Spring, saying he wanted to defend freedom of expression.
Some independent religious scholars argue the cartoonists were wrong to offend Muslims and say the drawings made dialogue impossible.
One of 12 cartoons published in the Danish newspaper Jyllands Posten, it depicted the Prophet Muhammad with a bomb in his turban.
In 2006 the paper apologised for the cartoons, but other European media reprinted them.
Danish embassies were then attacked by Muslims around the world and dozens killed in riots.
Mr Westergaard went in to hiding amid threats to his life, but emerged last year saying he wanted to live as normal a life as possible.
His house has been heavily fortified and is under close police protection.
Police said the man had entered Mr Westergaard's house armed with a knife and axe and had shouted in broken English that he wanted to kill him.
Mr Westergaard ran to a specially designed panic room where he raised the alarm.
Fritz Keldsen, deputy chief superintendent of Aarhus city police, told the BBC: "We got the alarm message from this address, yesterday evening. And we came in strong numbers.
SOMALIA'S ISLAMIST REBELS
Al-Shabab, meaning "the lads" in Somali, is on US foreign terror list
Youth wing of Somalia's Union of Islamic Courts that once held sway
Re-emerged after UIC ousted by Ethiopian troops in late 2006
Accused of al-Qaeda links and trying to topple interim government
Accused of Dec '09 suicide bomb on Mogadishu doctors' graduation
Blamed for 2008 stoning of 13-year-old Somali 'gang rape victim'
"When we saw the suspect, he was moving away from the scene. Then he attacked the police patrol. He did that with such skill, that they had to shoot him.
"The suspect was armed with an axe and a knife, which he used against the police. The police patrol managed to subdue him, with the use of firearms."
Police said the suspect was shot in the knee and the shoulder, but his life was not in danger.
Mr Westergaard told Jyllands Posten he was shocked that his five-year-old granddaughter, who was in the house at the time, had witnessed the attack.
He has now been taken to a safe location, but said defiantly that he would be back, the newspaper reported.
Jakob Scharf, who heads the Danish intelligence service Pet, said the attack was "terror related" and that the suspected assailant has close contacts to Somalia's al-Shabab group.
He had been under surveillance for activities unrelated to Mr Westergaard, Mr Scharf said.
Islamic militants have placed a $1m price on Mr Westergaard's head.
Although he is one of 12 cartoonists whose drawings of the Prophet Muhammad were published in Jyllands-Posten, he has the highest profile, our correspondent says.