The defence and prosecution both said they would appeal against the ruling.
Last month, a Yemeni court sentenced Kamal al-Aalafi, editor of Al-Rai al-Aam newspaper, to one year in prison for reprinting the cartoons, which first appeared in a Danish daily in September 2005.
The cartoons, one of which depicted the prophet with a bomb in his turban, were seen by many as blasphemous and sparked protests early in 2006. More than 50 people were killed in Asia, Africa and the Middle East in the unrest.
The editor of Al-Hurriya, another Yemeni publication, faces similar charges despite promises from Ali Abdullah Saleh, the Yemeni president, to scrap jail terms for journalists convicted of violations in publishing.