Chancellor Angela Merkel's cabinet decided to abolish by January 1, 2018 the rarely enforced section of the criminal code.
Chancellor Angela Merkel's cabinet decided to abolish by January 1, 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 Boehmermann, 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 migrants from the Middle East and Africa into the bloc, especially to Germany.
In the poem, broadcast in March last year, Boehmermann 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 authorised criminal proceedings against Boehmermann, 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 Boehmermann but dropped the case last October.