Story highlights German law prohibits insulting representatives of foreign countries

Angela Merkel: German government will examine Turkey's complaint closely

Investigation comes as Germany seeks Turkey's help stemming migrant crisis

(CNN) Perhaps it seemed funny at the time. But just how funny is it to have the President of Turkey lodge a criminal complaint against you? And looking at the possibility of three years in prison might not be all that hilarious.

But that is life these days for a German comedian named Jan Boehmermann.

Boehmermann, host of the show "Neo Magazin Royale" on the German public TV station ZDF, read on the air a sexually crude poem that referred, jokingly, to Turkish President Recep Tayyip Erdogan.

The Turkish Embassy, unamused, initiated legal action last week against the comedian, saying he had violated Germany's law prohibiting insulting representatives of foreign countries.

Boehmermann faces a maximum sentence of three years in prison.