The German government voted Wednesday to scrap a "lese majeste" law that Turkish President Recep Tayyip Erdogan had sought to employ against a popular German television satirist.
Chancellor Angela Merkel's cabinet decided to abolish by January 1st, 2018 the rarely enforced section of the criminal code that prohibits insulting organs or representatives of foreign states.
"The idea of 'lese majeste' dates back to a long-gone era, it no longer belongs in our criminal law," said Justice Minister Heiko Maas.
"The regulation is obsolete and unnecessary."
Maas said heads of state and government would still be able to defend themselves against slander and defamation "but no more or less so than any other person."
Erdogan had launched a criminal complaint under the law - which carries up to three years' jail - against German TV comic Jan Böhmermann, who had insulted him in a so-called "defamatory poem".
The row badly soured Berlin-Ankara relations at a time when Turkey was vital to European Union plans to stop the mass flow of immigrants from the Middle East and Africa into the bloc, especially to Germany.
In the poem, broadcast in March last year, Böhmermann had accused Erdogan of bestiality and watching child porn, while gleefully admitting that he was flouting legal limits to free speech as a deliberate provocation.
Merkel then authorized criminal proceedings against Böhmermann, in a decision that appalled rights groups.
At the same time she said the article should be removed from Germany's legal code, a move that still requires parliamentary approval.
Prosecutors had launched an investigation against Böhmermann but dropped the case last October.