The two cartoonists said in their trial they had done nothing wrong

Their cartoon, on the front page of the weekly satirical magazine El Jueves in July, depicted Crown Prince Felipe and his wife Letizia having sex.

The edition was pulled from newsstands across the country by police.

A judge said that El Jueves' Guillermo Torres and Manel Fontdevila "had vilified the crown in the most gratuitous and unnecessary way".

Torres had drawn the cartoon and Fontdevila, the paper's cartoons editor, wrote the caption.

"Do you realise," says the crown prince in the cartoon, "if you get pregnant this will be the closest thing I've done to work in my whole life."

That referred to an announcement by the government that it would pay Spanish couples for each new baby they had.

Several months before, in April, the royal couple had their second baby, Sofia.

'Gratuitous and unnecessary'

Prince Felipe and Letizia were portrayed in an "explicit sexual posture" prosecutors said.

Slandering or defaming the Spanish royal family can carry a sentence of up to two years in prison.

During their short trial, the defendants said they had done nothing wrong and had depicted members of the royal family in cartoons many times before.

Trade unions representing journalists have accused the Spanish judiciary of impeding freedom of speech, says the BBC's Steve Kingstone in Madrid.

Prince Felipe, 39, married Letizia Ortiz, 34, a former television news presenter, in May 2004.

They have two girls: Leonor, born in October 2005 and Sofia, born in April 2007.