A Somali man convicted of terrorism for breaking into the home of a Danish cartoonist who had caricatured the Prophet Muhammad was sentenced Friday to nine years in prison.

The Aarhus city court ruled that Muhideen Mohammed Geelle should be expelled from Denmark after serving his sentence.

Defense lawyer Niels Christian Strauss told The Associated Press he had launched an appeal against the conviction and sentence.

The 29-year-old entered cartoonist Kurt Westergaard's home armed with an ax on New Year's Day 2010. Westergaard locked himself inside a panic room and was unharmed. Police arrived and shot Geelle in the leg.

The court on Thursday found Geelle guilty of terrorism.

Strauss said he had appealed as the attack was not an act of terror, as his client had no intention of physically harming Westergaard.

Geelle had testified that he did not want to kill Westergaard, he just wanted to scare him and broke into his home after reading on the Internet that the 75-year-old Dane "was proud of the drawing and wanted to do more."

Westergaard's drawing was one of 12 cartoons of Muhammad published by a Danish newspaper in September 2005, triggering violent protests across the Muslim world four months later.

The prosecution, however, said Geelle had intended to kill Westergaard and that the crime should be viewed as terrorism as it was meant to "seriously frighten the population" and destabilize Denmark. It did not, however, link Geelle to any terror group.

The court also found Geelle guilty of assaulting a police officer, but acquitted him of a charge of attempted murder for throwing the ax at police when they confronted him on arrival at Westergaard's home in Aarhus, northwestern Denmark.

No date has been set for the appeal.