By Annabella Nielsen

COPENHAGEN (Reuters) - A Danish-Moroccan bookseller has been jailed for four years for supporting and inciting terrorism in posts on Facebook.

A lawyer for bookseller Sam Mansour argued that his Facebook messages such as "We are terrorists, and we are proud" were a matter of freedom of speech, just as Danish cartoonists who drew the Prophet Mohammad in 2005, outraging many Muslims, were deemed to have been exercising their right to free speech.

"I just used the civil rights that Danish society has given me," Mansour said in his defence statement, adding that he had hurt no one.

But a court in the capital, Copenhagen, rejected that argument and ruled late on Thursday that Mansour had directly incited violence and terrorism.

Mansour's other posts included "Jihad is a duty".

He also posted photo-shopped pictures of the severed head of one of the cartoonists who drew Mohammad. The cartoonist's head was pictured in a toilet and surrounded by flames and blood.

Mansour was jailed for three and a half years in 2007 on the same charge. Both then and in this latest case, the prosecutor suggested he be deported back to Morocco.

Mansour, 54, sat calmly during the hearing, occasionally smiling at his supporters, who were behind a glass partition.

Many supporters were teenaged boys with bushy beards, checking their smartphones and joking with court guards. Among the supporters were six women in black niqabas.

During one of many breaks in the hearing, Mansour spoke with his supporters, one of whom shook his hand through a gap in the partition and told him: "Good things will come to you, Sam".

The 2005 cartoons of Mohammad, published in various Danish newspapers, sparked heated debate about freedom of speech at home and protests in various parts of the Muslim world in which at least 50 people were killed.

For many Muslims, any depiction of Mohammad is blasphemous.

(Editing by Robert Birsel)