HAMBURG, Germany (Reuters) - A German court on Tuesday rejected Turkish President Tayyip Erdogan’s appeal to ban outright a satirical poem recited by a comedian on German television, which had soured already-strained ties between Berlin and Ankara.

FILE PHOTO: The President of Turkey, Recep Tayyip Erdogan, speaks at Chatham House in central London, Britain May 14, 2018. REUTERS/Henry Nicholls/File Photo

But judges also upheld a ban by a lower court in 2017 on certain passages of the poem, read out two years ago by German comedian Jan Boehmermann, and which suggested Erdogan engaged in bestiality and watched child pornography.

The higher regional court of Hamburg confirmed the ruling of the district court of Hamburg that parts of the poem could be banned because they contained degradations of an intimate and sexual nature for which there was no evidence.

Boehmermann had appealed for the partial ban to be lifted.

The court ruled the poem could not be completely banned because of Germany’s free speech laws.

“Satire can be art but it doesn’t have to be,” said Judge Andreas Buske. “If satire is not art, it is protected by the freedom of opinion.”

It decided that in view of developments in Turkey under Erdogan’s leadership, criticism - including severe criticism - is admissible and Erdogan must accept that.

Years of progress towards European Union standards in human rights, freedom of expression and the rule of law are being reversed in Turkey, an EU official warned in April.

In a separate case, German prosecutors in Mainz in October 2016 dropped an investigation into Boehmermann, who was accused of offending a foreign leader after reciting the poem.

They said they had not found sufficient evidence to suggest that any criminal offences had been committed by Boehmermann or anyone else involved in making or broadcasting the piece.