Freed American pastor Andrew Brunson prays with President Trump at the White House on Saturday.

Aykan Erdemir, a former member of the Turkish parliament (2011-2015), is a senior fellow at the Foundation for Defense of Democracies. (He provided unpaid advice to the American Center for Law and Justice, a nonprofit organization that represents Andrew Brunson’s family.) Merve Tahiroglu is a research associate at the Foundation for Defense of Democracies.

In a major reversal Friday, a Turkish court ordered the release of pastor Andrew Craig Brunson, an American evangelical missionary jailed in Turkey for the past two years. The pastor’s prosecution, based on farcical charges of espionage and conspiracy, had rattled Turkish American relations for the past year, triggering a diplomatic spat and prompting Washington to impose sanctions on Turkey this summer. As signaled by Secretary of State Mike Pompeo last week, Brunson’s release is set to calm tensions between the two NATO allies. But that move is likely to prove premature.

The two-year saga of Brunson’s case clearly illustrates Turkish President Recep Tayyip Erdogan’s grip on his country’s justice system, and the direct power that he holds over Turkish court proceedings. Erdogan has used that power to pursue a policy of “hostage diplomacy,” using Western prisoners to extract concessions in exchange for their liberty. Although the United States should of course welcome Brunson’s release, it should not offer Erdogan carte blanche for the Turkish strongman’s blatant breach of international norms.

The ludicrous charges against Brunson frustrated international observers since the very beginning. The 62-page indictment, far from reflecting a serious investigation, offered a hodgepodge of Turkish conspiracy theories about the United States, Kurds and Mormons (even though Brunson is a Presbyterian minister). The document comically spun mundane details about the pastor’s life, including a culinary video and the colors of a scarf, to level allegations of espionage based on the feelings and hunches of “secret witnesses.” Indeed, during the court proceedings Friday, all four state witnesses retracted their testimonies, denying any knowledge of the pastor’s links to terrorism or espionage. Two of them even cited each other as the source of their initial accusations.

So what accounts for the sudden change of heart of the witnesses, prosecutors and judges after two years? The U-turn is the latest example of an alarming trend in Turkish diplomatic conduct: Erdogan’s apparent strategy of using imprisoned Western citizens as bargaining chips in diplomatic dealings with Turkey’s NATO allies.

Brunson’s case has been entangled in alleged negotiations between Erdogan and the White House since the pastor was incarcerated in late 2016. In July 2017, rumors began to circulate that Ankara was trying to swap Brunson for Reza Zarrab, a Turkish Iranian sanctions-evader detained in the United States pending trial. A swap deal never transpired, and Zarrab pleaded guilty in a Manhattan federal court later that year.

In September 2017, Erdogan confirmed his intention to use Brunson as a bargaining chip when he declared, “give us our pastor and we’ll give you yours,” referring to the U.S.-based Turkish cleric Fethullah Gulen, whom Erdogan accuses of plotting Turkey’s July 2016 coup attempt. Then, this July, in the lead-up to Brunson’s third court hearing, President Trump acknowledged a deal he made with Erdogan for Brunson’s release in exchange for getting Israel to free a Turkish detainee there. That deal also reportedly fell through after Ankara demanded further concessions — namely, that Washington turn a blind eye to Turkey’s former schemes to evade U.S. sanctions against Iran — which the United States rejected.

The pastor’s release Friday also followed reports Thursday of a secret deal between the United States and Turkey.

If true, such a deal would be a grave mistake. Turkey reportedly jailed 20 Americans under Erdogan’s “state of emergency” after the failed coup of July 2016. At least two of them remain imprisoned or under house arrest. Meanwhile, three Turkish employees of the U.S. consulates in Istanbul and Adana remain in jail or on house arrest on spurious charges. Dozens of European nationals have also been imprisoned under similar charges.

Any swap deals for these prisoners would only encourage Erdogan’s hostage-taking and additional sham trials in Turkey. Milking concessions out of Washington and European capitals is exactly what Erdogan wants out of this sinister scheme. The hostages themselves are well aware of the repercussions of appeasing Erdogan: German nationals Deniz Yucel and Mesale Tolu both publicly appealed to the German government not to make any deals with Ankara for their release. Washington should take note.

Erdogan’s hostage diplomacy is a result of Turkey’s drift away from the transatlantic alliance and its values. But ending the hostage diplomacy requires only the strong resolve of Turkey’s NATO allies.

Rather than treating Turkey’s detentions and hostage-taking as isolated cases, the United States and its European partners must coordinate a transatlantic response. This will require a principled stance with clearly communicated incentives and disincentives. There must be an end to appeasement and individual swap deals.

Far from championing Erdogan for finally allowing an innocent pastor to walk free, the United States must refrain from normalizing the Turkish strongman’s thuggery until all hostages are free. The ultimate goal for the transatlantic world must be to help their wayward ally return to the rules-bound international order. Only that scenario can end Erdogan’s hostage diplomacy — and offer, perhaps, a glimmer of hope to Turkey’s own imprisoned dissidents as well.

Read more:

The Post’s View: Trump is right to push Turkey. He’s just doing it wrong.

Robert J. Samuelson: Will what happens in Turkey stay in Turkey?

The Post’s View: Erdogan’s thugs still need to be brought to justice