Erdogan sued Boehmermann
Erdogan (L) sued Boehmermann for insulting him on German television Getty

A German court has banned a satirist Jan Boehmermann from repeating parts of an obscene poem mocking Turkish president Recep Tayyip Erdogan. The court in Hamburg ruled that though the poem was satirical, sexual references in it accusing Erdogan of bestiality and child abuse were unacceptable.

"Through the poem's reference to racist prejudice and religious slander as well as sexual habits the verses in question go beyond what the petitioner can be expected to tolerate," the court said.

It rules though that six lines criticising Erdogan's clampdown on freedom of speech and treatment of minorities in Turkey were acceptable.

After Boehmermann read out the poem on television in March, Erdogan filed a lawsuit against the comedian. German Chancellor Angela Merkel allowed the prosecution to proceed under obscure legislation banning insults against foreign heads of state.

Prosecutors have not yet decided whether to press charges.

Boehmermann's lawyer criticised the Hamburg court's decision: "We believe that the court's decision in its concrete form is wrong, given that it deems those parts dealing with Erdogan's approach to freedom of expression to be acceptable," said Christian Schertz.

One of Germany's most controversial satirists, Boehmermann has accused Merkel of "filleting him" and "serving him" to Erdogan in allowing the prosecution to proceed. Defenders claim he has exposed the frailty of freedom of speech in Germany at a time when the country requires Turkish support to help mitigate the refugee crisis. Others claim the poem is vulgar and puerile.