Turkey's President Recep Tayyip Erdogan waves to supporters of his ruling Justice and Development Party (AKP) Saturday prior to his speech during a rally in Kocaeli, Turkey. Credit: Presidential Press Service via AP

RIYADH — As Secretary of State Mike Pompeo criss-crossed the Middle East to explain the U.S. military withdrawal from Syria this week, he repeated that he was “confident” and “optimistic” that he was nearing a deal with Turkey on a mutually agreeable exit plan.

But a pugnacious tweet from President Donald Trump on Sunday night vowing to “devastate” the Turkish economy if Ankara attacks U.S.-backed Kurds revealed a much wider chasm between the two sides and prompted a new round of recriminations from Turkey.

The United States “will devastate Turkey economically if they hit Kurds,” Trump tweeted.

Hours later, Turkish Foreign Minister Mevlut Cavusoglu blasted Trump’s “threatening language” and said his country was “not going to be scared or frightened off. You will not get anywhere by threatening Turkey’s economy.”

The row marked the second time in a week that the White House intervened in negotiations led by the State Department that infuriated Turkey and caught U.S. diplomats flat-footed.

In trying to explain Trump’s tweets on Monday, Pompeo told reporters in Riyadh that he assumed Trump meant the United States would levy sanctions on Turkey if they attacked the Kurds but that he didn’t know for certain.

“I assume he’s speaking about those kinds of things, but you would have to ask him,” said Pompeo, who noted that he had not talked to Trump about the tweet.

It wasn’t the first instance of mixed messaging from the White House and State Department on the delicate issue of leaving Syria.

Last week, Turkish President Recep Tayyip Erdogan erupted after National Security Adviser John Bolton made remarks conditioning the withdrawal of American troops from Syria on protection of Syrian Kurdish fighters who fought with the United States against the Islamic State. Turkey’s government considers the Syrian Kurdish fighters, also known as the YPG, as part of a terrorist movement and has vowed to attack them after the United States withdraws.

Bolton intended to refer specifically to America’s Kurdish proxy forces, but he struck a nerve by using imprecise language and appearing to dictate to Erdogan, U.S. and Turkish officials said.

The misstep angered James Jeffrey, the U.S. special envoy to the anti-Islamic State coalition, who had been immersed in negotiations with the Turks when Bolton’s comment upended the talks, according to three people familiar with the negotiations.

Trump’s abrupt order to withdraw from Syria in December surprised U.S. allies and has left questions about the pace and scale of the pullout. Trump originally said U.S. troops were leaving “now,” but he has since said it would happen “slowly” after the United States ensured a lasting defeat of the Islamic State.

Pompeo said U.S. messaging over concerns about Turkish attacks on the Kurds has never changed.

“The administration has been very consistent with respect to our requirement that the Turks not go after the Kurds in ways that are inappropriate,” Pompeo said. “If they are terrorists, we’re all about taking down extremists wherever we find them. I think the president’s comments this morning are consistent with that.”

Trump’s tweet, which preceded the Turkish lira losing about 0.84 percent of its value against the dollar, included a demand that Turkey create a “20-mile safe zone.”

Pompeo said U.S. and Turkish diplomats had been negotiating such an arrangement this week, but nothing had been finalized.

“We want to make sure that the folks who fought with us to take down the caliphate and ISIS have security and also that terrorists [in] Syria aren’t able to attack Turkey — those are our twin aims,” he told reporters after meeting with the leaders of Saudi Arabia in Riyadh.

“Both sides are trying to negotiate the width of a potential safe zone,” said Soner Cagaptay, a Turkey scholar at the Washington Institute for Near East Policy. “The idea is that Turkish troops and Ankara-backed forces would move into the rural areas in the safe zone, while the YPG would retain control of some of the Kurdish majority cities. This would be a sharing agreement that might be acceptable to all sides, if the U.S. stands behind it.”

Cavusoglu expressed support for the 20-mile safe zone on Monday, saying it had long been a Turkish objective.

“They bandied this idea after they saw Turkey’s determination,” Cavusoglu said. “We are not against it.”

With potential room for agreement, Cagaptay said a key factor will be avoiding diplomatic gaffes. “If there is one thing that makes the Turks’ blood boil, it is language that equates the Kurds and the YPG,” he said.

Washington Post writer Anne Gearan contributed to this report.