A Somali who attacked the home of a Danish cartoonist who caricatured the Prophet Muhammad has been jailed for nine years by a Danish court. Mohamed Geele, 29, was convicted on Thursday of attempted murder and terrorism after his attack last year on Kurt Westergaard, 75. Mr Westergaard avoided injury by sheltering in a panic room at his home in the city of Aarhus. Geele also faces deportation to Somalia at the end of his sentence. The maximum penalty he had faced was a life sentence and prosecutors sought 12 years. Geele's defence lawyer, Niels Strauss, had asked for, at most, a suspended six-year sentence and for his client not to be deported During the trial, the court heard that Geele broke into Mr Westergaard's house in Aarhus on New Year's Day 2010, smashing the door down. Mr Westergaard was at home with his five-year-old granddaughter Stephanie at the time. Geele, who was armed with an axe and a knife, screamed "You must die!" and "You are going to Hell!", the cartoonist told the court. He locked himself in his panic room - a reinforced bathroom - leaving Stephanie alone in the living-room because his attacker was "after me, not the people around me". The little girl, who was unhurt in the attack, testified that she had thought Geele was a thief and had asked him to go away. Geele tried to get into the bathroom, hacking at the door with his axe, but fled when he heard police sirens. Still armed, he was shot and wounded by police arriving at the scene, who then arrested him. 'Al-Shababa links' In its verdict on Thursday, the court noted that the attack had been well planned. Geele had searched for the cartoonist's address on the internet and, on New Year's Eve, bought the axe and sharpened the knife, which he already possessed. While acquitted of the charge of attempting to murder a policeman, brought because he threw his axe at one of the officers who arrived to arrest him, Geele was found guilty of aggravated assault on the officer. The convicted man arrived in Denmark in 1995 as a refugee from the country's civil war, and was granted indefinite leave to remain, according to an article in the New York Times. Living in the city of Aalborg, he was involved in a youth club, where he became a role model for others, former club worker Nuuradiin Hussein said.