The choice Angela Merkel had when Turkey’s imperious president, Recep Tayyip Erdogan, demanded that Germany prosecute a comedian was a variation on the dilemma posed by a kidnapper: Paying the ransom solves the immediate problem but sets a dangerous precedent.

Chancellor Merkel had to decide between appeasing Mr. Erdogan’s outrageous demand or potentially losing a deal with Turkey that promised some relief from the refugee crisis. Under the agreement between the European Union and Turkey, Ankara has agreed to accept refugees turned back from Greece in exchange for more aid and reopening talks on Turkey’s accession to the E.U.

Ms. Merkel allowed the case to proceed. Now the question is what Mr. Erdogan — or some other miffed potentate — will demand next.

Ms. Merkel can argue that she chose the lesser of two political evils, that the ceaseless flood of refugees was undermining the European Union and that all she did was to clear the way for German courts to determine whether to prosecute the satirist, Jan Böhmermann, under an archaic law against insulting foreign leaders. Mr. Böhmermann, a comedian and host of a late-night talk show, deliberately did just that on March 31 when he broadcast a poem that had Mr. Erdogan committing sex with animals and “kicking Kurds and beating up Christians while watching child porn.”

The trouble is that Mr. Erdogan was not just going after an obscure comedian; he was also demanding that the head of the German government publicly recognize his claim that it is wrong to ridicule him. Satire is no laughing matter to Mr. Erdogan; according to Turkey’s justice minister, 1,845 cases have been opened against people accused of violating a law against insulting the president. The crackdown has been central to Mr. Erdogan’s authoritarian drive, and he can now claim that the West accepts the legitimacy of his approach.

Leaders like Mr. Erdogan, President Vladimir Putin of Russia and President Xi Jinping of China are increasingly demanding that their autocratic rules be seen as not only legitimate but as effective — demands that will only grow as they become more powerful.

But the freedom to lampoon political leaders — or religions, as in the case of Charlie Hebdo — is one of the crucial differences between liberal democracies and authoritarian states. Freedom of expression simply cannot be negotiated with autocrats, dictators or bullies. Ms. Merkel has been rightly praised for her willingness to let large numbers of refugees into Germany. She is right to seek Turkey’s help in resolving the crisis, since without Turkey there is no solution. But she should have made clear to Mr. Erdogan that Western freedoms were not on the table.