By Jan Schwartz

HAMBURG, Germany (Reuters) - A German court weighed up the limits of artistic freedom on Wednesday in considering whether to ban a satirical poem that mocked Turkish President Tayyip Erdogan and caused a diplomatic spat between Ankara and Berlin.

The Hamburg court had issued a preliminary injunction in May banning re-publication of parts of the poem, suggesting the president engaged in bestiality and watched child pornography, which Jan Boehmermann recited on German television in March.

The row has soured already tense relations between Germany and Turkey at a time when the European Union is looking to Ankara for support in tackling the migrant crisis.

A resolution passed by Germany's parliament in June that declared the 1915 massacre of Armenians by Ottoman forces to be a genocide further worsened relations.

The crux of the legal arguments is weighing the right to artistic freedom with the personal rights of Erdogan, the court has said. In its May ruling, it marked 18 of the poem's 24 verses as "abusive and defaming".

Boehmermann's lawyer Christian Schertz said he expected the court to reject the lawsuit claiming slander and offense.

"Artistic freedom is protected here and I think that the court assessed some things incorrectly in their previous ruling," he told reporters. The poem had to be evaluated as part of a whole performance exploring what satire is allowed, he said.

The court said it would make its ruling on Feb. 10 in the civil case.

Last month, prosecutors in the town of Mainz dropped a separate investigation into Boehmermann who was accused of offending a foreign leader with the poem.

Chancellor Angela Merkel was widely criticized for giving prosecutors the nod to pursue the case against the comedian and it prompted the government to say it would rescind an archaic law forbidding insults of foreign leaders.

Erdogan's lawyer Michael-Hubertus von Sprenger told reporters there was no conflict between human dignity and freedom of artistic expression.

"Human dignity is inviolable. There is no trade-off ... There is nothing to consider," he said.

(Reporting by Reuters TV and Jan Schwartz; Writing by Madeline Chambers; Editing by Richard Balmforth)