A judge in Aarhus Municipal Court ordered Mohamed Geele, 29, to be deported when he is released from prison, the Copenhagen Post reported.
Geele was convicted Thursday of attempted murder and attempted terrorism. He broke into Westergaard's house in Aarhus on Jan. 1, 2010, armed with an ax and knife and tried to batter down the door of the panic room where the cartoonist was hiding.
Westergaard infuriated Muslims with a 2005 cartoon in the newspaper Jyllands-Posten that showed the Prophet Mohammed with a bomb protruding from his turban.
In court, Geele denied intending to kill Westergaard, saying he only wanted to scare him. Westergaard said Geele yelled death threats as he pounded on the panic room door with his ax.
Niels Christian Strauss had asked for a suspended sentence with his client allowed to remain in Denmark. Prosecutors sought a 12-year sentence followed by deportation.
Geele came to Denmark as a child in 1991.
2014: The Year in Music [PHOTOS]