German prosecutors have dropped an investigation into a TV comedian accused of insulting Turkish President Recep Tayyip Erdogan.
The prosecutors in the western city of Mainz said they had not found sufficient evidence to continue the inquiry against Jan Boehmermann.
In March, Boehmermann recited a satirical poem on TV which made sexual references to Mr Erdogan.
Mr Erdogan then filed a complaint alleging that he had been insulted.
In a statement on Tuesday, the prosecutors said that "criminal actions could not be proven with the necessary certainty".
It was "questionable", the statement added, whether Boehmermann's poem constituted slander, given the satirical context in which the comedian recited it.
In April, German Chancellor Angela Merkel Germany said her government would allow the potential prosecution of the comedian, triggering criticism that she did not stand up for free speech.
Under German law, the cabinet had to approve a criminal inquiry.
However, Mrs Merkel added that the authorities would move to repeal the controversial and little-used Article 103 of the penal code, which concerns insults against foreign heads of state, by 2018.
Borderline racist or clever satire? By Damien McGuinness, BBC News, Berlin
Was the poem a dangerous, illegal, borderline racist insult? Or was it a clever satire poking fun at German media and the country's outdated legal system? And what is satire anyway?
Given that Jan Boehmermann could, at the request of a controversial foreign leader, conceivably have ended up prison over this gag, these suddenly seemed like very important questions in Germany.
In the end it seems that Boehmermann's head-spinning self-referential irony has made it impossible for a court to say whether he was actually insulting Erdogan or not.
Anyone who says Germans don't have a sense of humour, doesn't know Germany - and has certainly never seen Boehmermann in action.
Irreverent to the point of discomfort, he is so subversive that you're often not sure if he's making fun of himself, someone else or you.
During the height of tensions between Athens and Berlin over the Greek debt crisis Boehmermann portrayed Greek Finance Minister Yanis Varoufakis as a vengeful motorbike-riding sex bomb.
But it was in fact his fellow Germans, and the rest of the media establishment, that the comedian was mocking.
A jaunty 1930's-style Springtime for Hitler remake wittily highlighted the similarities between the views of the anti-migrant party AfD and Nazi-era politics.
Even refugee helpers have been fair game, as Boehmermann mercilessly portrayed modern, multi-cultural Germans as an unstoppable horde of muesli-eating, Birkenstock-wearers.
He clearly thinks they're right and the AfD is wrong. But that doesn't stop him making them look ridiculous.
Boehmermann is a satirist and television presenter well-known for pushing the boundaries of German humour.
The poem was broadcast on ZDF television. The comedian was later given police protection.
Mr Erdogan has drawn much criticism in Turkey and internationally for attacking political opponents, including harassment of journalists. Many accuse him of authoritarian methods, stifling legitimate dissent and promoting an Islamist agenda.
A rarely used article of the criminal code
Paragraph 103 of Germany's penal code, on defamation of organs and representatives of foreign states, has the following to say:
(1) Whosoever insults a foreign head of state, or, with respect to his position, a member of a foreign government who is in Germany in his official capacity, or a head of a foreign diplomatic mission who is accredited in the federal territory shall be liable to imprisonment not exceeding three years or a fine, in case of a slanderous insult to imprisonment from three months to five years.
The article dates back to the penal code drafted when the German Empire was formed in 1871, although at that time it just applied to monarchs.
It has been little used in recent years and is colloquially known as the "Shah law" among German lawyers after the Shah of Persia successfully brought a case against a Cologne newspaper in 1964.
A Swiss man living in Bavaria was also prosecuted under the article in 2007, after he posted offensive comments about then Swiss President Micheline Calmy-Rey on the internet.