Angela Merkel is facing a backlash following the collapse of a criminal case her government authorised against one of Germany’s most popular comedians for insulting the Turkish president, Recep Tayyip Erdogan.

Jan Böhmermann lashed out at Mrs Merkel’s government in his first public comments since prosecutors announced this week they were dropping the case against him for lack of evidence.

“If a joke causes a constitutional crisis, it’s not the joke that’s the problem, it’s the state,” Mr Böhmermann said.

Although the 35-year-old did not mention Mrs Merkel by name, the remark was clearly aimed at her government’s decision to allow the prosecution under Germany’s rarely invoked lese-majeste law.

His lawyer went further, accusing Mrs Merkel of prejudicing the case against him.

Public statements the chancellor made about the case “amounted to a public prejudgement” and “violated the constitutional principle of the separation of powers,” Christian Schertz said.

The Turkish government demanded Mr Böhmermann’s prosecution over a poem he read out on television in which he called Mr Erdogan a “goat-f*****” and described him watching child pornography.

Mr Böhmermann faced up to five years in prison under the lese-majeste law, which prohibits insulting a foreign head of state.

Prosecutions require the approval of the German government, and Mrs Merkel was accused of seeking to appease the authoritarian Mr Erdogan and safeguard the EU’s controversial migrant deal with Turkey when her government made the surprise decision to let the case go ahead.