Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today's WorldView newsletter.

President Trump may have squabbled with Western European leaders on a trip to NATO headquarters last month and cast the European Union as a “foe,” but he displayed plenty of warmth for Turkish President Recep Tayyip Erdogan. According to one account, Trump “fist-bumped” his Turkish counterpart when they met in Brussels, praising a leader known for his authoritarian style as someone who “does things the right way.”

But it seems that Trump and Erdogan are no longer on fist-bumping terms. On Wednesday, the White House announced it was preparing sanctions against Turkish Justice Minister Abdulhamit Gul and Interior Minister Suleyman Soylu for their roles in the continued detention of American pastor Andrew Brunson, who U.S. officials say was arrested in 2016 on fictitious charges.

The sanctions move was eye-catching, given the historic nature of the U.S.-Turkish relationship. The two countries are NATO allies, after all, and Turkey hosts American troops and aircraft at a strategic air base in the country's south. Although the sanctions are mostly symbolic — they target the U.S. assets of just two officials — the news still sent jitters through Turkey's stock market and caused the already enfeebled Turkish lira to plummet to new lows.

But it wasn't altogether surprising. Brunson, who has lived and proselytized in Turkey for more than two decades, is a pawn in a much wider geopolitical game and is seen as a “hostage” by U.S. officials. He was arrested amid the vast purge in Turkey that followed a failed attempt to topple Erdogan's government in 2016. Turkish authorities accuse Brunson of complicity in the botched putsch — tens of thousands of Turks face similar charges — which he denies.

Vice President Pence, an evangelical Christian, has aggressively taken up Brunson's case, focusing on the pastor's religiosity. That emphasis is lamented by Turkey watchers in the United States, who wish the White House showed more interest in other political prisoners in the country. Trump, though, has hailed Erdogan's iron fist and indicated throughout his time in office that the Turkish leader is somebody with whom he could do business.

Various accounts of recent rounds of diplomacy between Ankara and Washington suggest Erdogan and his lieutenants hoped to use Brunson as a negotiating chip in a legal battle over the evasion of U.S. sanctions on Iran by a state-run Turkish lender, Halkbank.

“As of last week, the Americans thought they had a deal that would bring Brunson home,” reported Bloomberg News. “In return for the release of evangelical pastor . . . the U.S. administration would recommend a lenient fine on Halkbank. The U.S. also offered to send Mehmet Hakan Atilla, a former executive at the bank who’s been jailed in the U.S., back to Turkey to serve out the rest of his term.”

The White House had also compelled the Israeli government to release a Turkish citizen, Ebru Ozkan, arrested on suspicion of collaborating with the Islamist group Hamas. “Trump believed he had made a deal with the Turkish leader that included releasing Brunson in exchange for a Turkish woman being held in Israel on terrorism charges,” my colleagues Karen DeYoung and Felicia Sonmez reported.

But, according to Bloomberg News, Turkish Foreign Minister Mevlut Cavusoglu upended the deal when he insisted the Halkbank probe “be dropped” altogether. “Although [Ozkan] was released and deported to Istanbul, the Turkish court hearing Brunson’s case agreed last week only to allow him to leave prison for house arrest while his trial continued,” my colleagues reported.

The White House has reason to feel aggrieved, but so do the Turks, who see themselves as once more victimized by an unreliable partner in Washington. Anti-American rhetoric has been a fixture of the recent years of Erdogan's presidency, animated by the United States' support for Kurdish factions in Syria and its accommodation of Fethullah Gulen, an aging cleric living in Pennsylvania who Ankara says was behind the 2016 coup attempt.

The country's largely pro-Erdogan press rallied against the U.S. sanctions. A nationalist ally of the president's declared that Brunson should now be exchanged only for Gulen himself — a measure that would be rejected by Washington. A nationalist opposition party even suggested that the government seize the Trump Towers complex in Istanbul as retaliation. For its part, the Turkish Foreign Ministry on Thursday vowed an “equivalent response” to the sanctions, though it was not immediately clear what that might entail.

Erdogan may relish this new opportunity to wrap himself in the flag and rail against a foreign adversary. “Turkey’s president feels under siege. With both the United States government and parliamentary opponents accusing him of corruption, he will continue his domestic crackdown and his anti-American rhetoric,” wrote Nicholas Danforth, a Turkey expert at the Bipartisan Policy Center in Washington. “This is dangerous. Every newspaper closed or politician arrested, like every new diplomatic spat with the United States or Europe, will further strain Turkey’s social fabric and weaken its economy.”

There was optimism that Trump's rise to the presidency would help revive relations with Turkey, but lawmakers and the foreign policy elite in Washington have irrevocably soured on Erdogan.

“In Trump, Ankara once had a sympathetic ear. From the get-go, the U.S. president seemed eager to build a good relationship with Turkey’s strongman leader,” wrote Asli Aydintasbas for the European Council on Foreign Relations. “This accorded with the prevailing view of the foreign policy establishment in Washington, which continues to believe that it is important to keep Turkey anchored to the West. However, Erdogan’s anti-Western rhetoric, poor human rights record, and decision to purchase Russian S-400 antiaircraft systems have all made it harder for American friends of Turkey to make the case for improved relations.”

Now “the Trump administration and Congress have exhausted their strategic patience; they are now postured to change their approach and take steps intended to inflict economic pain on a NATO ally of 66 years,” wrote Amanda Sloat of the Brookings Institution. “There is still time for a diplomatic solution if both sides return to quiet talks rather than angry rhetoric.”

Those quiet talks may come sooner rather than later, given Turkey's faltering currency.

“Erdogan cannot afford a full-blown crisis with the U.S. given the fragility of Turkey’s economy,” Wolfango Piccoli, of the consultancy Teneo Intelligence, told the Financial Times. “In the short term, the US sanctions can be used to rally support around the flag. But economic reality will soon kick in, forcing Erdogan to reconsider his defiant stance.”

Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today's WorldView newsletter.