By Michelle Martin and Madeline Chambers
BERLIN (Reuters) - Turkey's Tayyip Erdogan has filed a legal complaint against a German comedian who recited a sexually crude satirical poem about him on television, embarrassing Angela Merkel who has only just enlisted the president's help in tackling the migrant crisis.
The poem, seemingly a deliberate provocation by comedian Jan Boehmermann, has exploded into a diplomatic incident that pits freedoms championed by Western Europe against recent moves in Turkey by Erdogan that critics say crack down on dissent.
Merkel, asked about the case, tried to separate the two issues and stressed her commitment to artistic freedom.
Prosecutors in Mainz said Erdogan had filed a complaint against Boehmermann for insulting him. Under the criminal code, he could, if found guilty, be imprisoned for up to a year.
In the March 31 program, Boehmermann host of late-night "Neo Magazin Royale" on public broadcaster ZDF, recited a poem about Erdogan with references to bestiality and accusations that he repressed minorities and mistreated Kurds and Christians.
Erdogan's German lawyer, Michael-Hubertus von Sprenger, said he was prepared to go to the highest court and added that the Turkish president wanted Boehmermann to be punished.
"He definitely won't get a heavy punishment, but rather it will be a punishment that is necessary to get him back on the right path - to produce satire, and not gross insults," Sprenger told German broadcaster ZDF.
German media reported that Boehmermann was under police protection and had canceled the next emission of "Neo Magazin Royale".
Prosecutors are conducting a parallel investigation into the comedian on suspicion of the more serious crime of "offending foreign states' organs and representatives" after Turkey made a formal request. If found guilty of that, Boehmermann could face up to three years in prison.
In the second potentially more serious case, the German government has to authorize prosecutors to go ahead. Berlin will decide on the request from Turkey in the coming days, Merkel said, adding that she cherished artistic freedom in Germany.
"Turkey is bearing a very big burden in relation to the Syrian civil war but all of that is completely separate from Germany's fundamental values ... freedom of the press, opinion and science apply and are completely separate from that," she told reporters.
This clause in question, which seems to require political intervention in the justice system, is rarely used, say experts. Some politicians have called for it to be abolished because it is antiquated.
In the last decade or so only a handful of cases have been initiated. Media reports say that in the 1960s, the Shah of Iran used the clause against the Koelner Stadt Anzeiger newspaper over a caricatured montage.
The law, which does not appear to exist in most other European countries, leaves Merkel with a conundrum.
If her government gives the nod to prosecutors, it could enrage Germans already dubious about what they view as her Faustian pact with Erdogan to help stem the flow of migrants.
"If the government supported the move, there would be a huge backlash domestically," Wolfgang Kubicki, a lawyer and senior member of the business-friendly FDP party, told NDR radio.
A YouGov poll showed 54 percent of Germans opposed an investigation into Boehmermann by prosecutors with only 6 percent in favor.
Yet if it rejects Ankara's request, Merkel could hurt relations with Turkey, a crucial partner in the migrant crisis and a candidate to join the European Union.
"We cannot tolerate this. We want this shameless man to be prosecuted under German law for insulting the president," Turkish government spokesman Numan Kurtulmus said in response to a question after a cabinet meeting on Monday.
Erdogan is known for his intolerance of criticism and his readiness to take legal action over perceived slurs. Turkish prosecutors have opened nearly 2,000 cases against people for insulting him since he became president in 2014, the justice minister said last month.
Critics say he is using the law to stifle dissent. Those who have faced such trials include journalists, cartoonists, academics and even school children.
Erdogan has said he is open to criticism, but draws the line at insults.
"I would (thank) each and every one of those who criticize me, but if they were to insult me, my lawyers will go and file a lawsuit," he said on the sidelines of a Nuclear Security Summit in Washington last month.
Boehmermann, no stranger to controversy, made clear he was being deliberately provocative. He introduced the poem by saying that a previous song, which had triggered initial protests from Turkey, were just comedy.
He said serious insults, however, would not be legal. "To be clear, we don't do this and would never do this. Never. But this is how it would look if we did..."
Among those who have stood up for him are Matthias Doepfner, the head of the Axel Springer media group, publisher of the bestselling tabloid Bild. He wrote in Die Welt that the incident has made society think about how it deals with satire and intolerant attitudes towards satire from non-democrats.
But, just over a year after the murder by Islamist militants of cartoonists at France's Charlie Hebdo satirical magazine unleashed a wave of support for Europe's cherished freedom of expression, German opinion is divided on Boehmermann.
"In a constitutional democracy we all have to stick to the rules, and one of these rules is that offending foreign heads of state is punishable by law," Peter Tauber, general secretary of Merkel's CDU told NTV television.
(Additional reporting by Michael Nienaber, Noah Barkin, Paul Carrel and Josefine Kaukemueller in Berlin, and by David Dolan in Ankara; Writing by Madeline Chambers; Editing by Giles Elgood and Hugh Lawson)