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.
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.