ISTANBUL — Consensus is rare in Turkey’s fractured society. But when Donald Trump won the U.S. elections, Turks across the political spectrum agreed: The new American president and Turkey's ruler Recep Tayyip Erdoğan would get along just fine.

How short that lasted. Erdoğan and his supporters have gone from confidence bordering on giddiness about the prospects for Turkish-American relations to disillusionment in less than a week of Trump in the White House.

Only weeks ago, government supporters pointed out with satisfaction that Trump had defeated his country’s old elites at the ballot box, just as Erdoğan did 15 years earlier. Government critics saw the similarities as well between, in their view, two thin-skinned populists with a penchant for lawsuits who were likely to see eye-to-eye.

Erdoğan congratulated Trump on his electoral victory, insisting that the president ought to visit Turkey “as soon as possible.” Ministers expressed hope for closer relations; ties between Ankara and Washington had become strained under the Obama administration. Meanwhile, Trump's Islamophobic rhetoric was written off as campaign talk.

During the campaign period, the Turkish government was less supportive of Trump than strongly opposed to Hillary Clinton, who was perceived as a threat to Turkey’s interests.

As Trump makes good on his pledges, the honeymoon is coming to an early end. “We are waiting to see what Mr. Trump will say about the Middle East,” Erdoğan told reporters last week. “At the moment, some language about the Middle East is reaching our ear, and it is frankly disturbing.”

While Erdoğan did not elaborate, he was not alone in expressing his dismay with the new administration. When Trump forged ahead with his “Muslim ban,” suspending visas for those born in seven Muslim-majority nations, Turkish ministers were quick to criticize the order.

“Regional issues cannot be solved by closing the doors on people,” said Binali Yıldırım, Turkey’s prime minister, at a press conference with his British counterpart Theresa May on Saturday. “You can build a wall. But it’s not a solution. That wall will come down like the Berlin Wall.”

Short honeymoon

Disagreement was probably inevitable. Turkey’s ruling party is rooted in Islamism and prides itself on giving a voice to religious conservatives. Erdoğan likes to cast himself as a representative and protector of Sunni Muslims across the Middle East; Ankara hosts exiled members of the Syrian opposition and various rebel groups, as well as Hamas and Egypt’s Muslim Brotherhood.

Trump, on the other hand, hit out at Muslims and Islam throughout his campaign, proposing not only a “Muslim ban” but also a “Muslim registry.” Over the summer, Erdoğan called for the Republican nominee’s name to be removed from Istanbul’s Trump Towers. Apart from that, barely a word of criticism was heard in Ankara’s corridors of power.

During the campaign period, the Turkish government was less supportive of Trump than strongly opposed to Hillary Clinton, who was perceived as a threat to Turkey’s interests. The Democratic nominee’s firm support for the Syrian Kurdish YPG militia put her at odds with Ankara. The YPG, widely regarded as the most efficient force in the fight against the Islamic State, has ties to the militant Kurdistan Workers’ Party (PKK), which has waged a three-decade insurgency against the Turkish state.

On top of that, Clinton’s campaign received donations from supposed supporters of Fethullah Gülen, the Pennsylvania-based cleric accused of masterminding an attempt to overthrow Erdoğan’s government last summer. Followers of Gülen have been the target of a sweeping purge in Turkey, with tens of thousands detained since the failed coup.

Gülen and U.S. support for Syrian Kurds had already soured relations under Obama’s administration. Turkish ministers’ calls for the extradition of Gülen fell on deaf ears in Washington, fueling frustration in Ankara. Turkey also repeatedly condemned what it saw as “support for terror," fretting that the international community’s endorsement of the YPG would bolster the PKK’s demands for autonomy in Turkey’s Kurdish-majority southeast.

“The optimism toward Trump was a reaction to the approach of the Obama administration during the last month of his term,” said Özgür Ünlühisarcıklı, who heads the Ankara office of the German Marshall Fund, a Washington-based think tank. “They thought that the Clinton administration would be a direct continuation of the Obama administration. They hoped that relations would improve under Trump.”

Schadenfreude

Early signs were promising. Turkish ministers applauded the election results; the pro-government press heaped praise on Trump. There was a palpable sense of schadenfreude that the Republican nominee had persevered despite “opposition” from the press. The minister for justice, Bekir Bozdağ, declared: “The American people said no to their will being manipulated.”

Shortly after the election, Erdoğan called anti-Trump protests “a disrespect to democracy.” Trump, in turn, reportedly told Erdoğan that his daughter Ivanka admired him. The Turkish president also lauded Trump’s approach to the press: After Trump lashed out at a CNN reporter during a press conference, labeling the broadcaster “fake news,” Erdoğan commended him for putting the journalist “in his place.” (Turkey currently jails more journalists than any other nation.)

Trump even appeared to lend his support to a plan long supported by Ankara to set up “safe zones” within Syria for refugees fleeing the violence.

Mike Pompeo, the new CIA director, declared Turkey a “totalitarian Islamist dictatorship” in a now-deleted tweet.

“Ankara’s initial optimism is now giving way to cynicism,” said Ünlühisarcıklı. “Turkey is puzzled — OK, a security zone, but what kind of security zone? Ankara is concerned it could be established in Kurdish areas, supporting the Kurds’ argument for autonomy.”

Ünlühisarcıklı warned that Turkey might be setting itself up for disappointment. Ankara’s hopes that Trump might speed up Gülen’s extraditions will likely amount to nothing, given that the cleric’s case is a matter for the U.S. judiciary.

Whether Trump will continue Obama’s support for the YPG is uncertain; Yıldırım and other ministers have expressed hope that the new administration would “bring an end to this shame” of supplying the YPG with weapons. Yet during his confirmation hearings, Trump’s pick for secretary of state, Rex Tillerson, named the Kurdish militia as the West’s greatest ally in the fight against the Islamic State. (In 2011, when he was head of Exxon Mobil, the company signed a contract to drill for oil in Iraqi Kurdistan not with the central Iraqi government in Baghdad, but with the Kurds.)

Other officials brought in by Trump may also spell trouble for Washington’s relationship with Turkey. Mike Pompeo, the new CIA director, declared Turkey a “totalitarian Islamist dictatorship” in a now-deleted tweet. Michael Flynn, Trump’s national security adviser, called Turkey a “source of stability” — but a video filmed during the night of July’s coup attempt shows him cheering on the plotters trying to overthrow Erdoğan.

As initial excitement over Trump’s election recedes, Ankara is beginning to grasp what the new administration might have in store for the Middle East. Conservative columnists were enraged at the suggestion to move the U.S. embassy in Israel from Tel Aviv to Jerusalem, an order that could provoke unrest in the region. Reports that Trump is considering designating the Muslim Brotherhood as a terrorist group are unlikely to have gone down well in Ankara, either.

Nor has Trump’s rhetoric of linking Islam to terrorism gone unnoticed. In his inauguration speech, Trump pledged to “eradicate” what he sees as “radical Islamic terrorism.” Ankara took note: “The predominant feature of the new administration is that it has developed a generalist and prejudiced approach to the Islamic world,” wrote a columnist for the pro-government Yeni Şafak newspaper.

Obama refused to speak of “Islamic terrorism” to avoid associating the religion with violence — something that Erdoğan, who is known to despise this phrase, may have appreciated.

“Obama was very sensitive toward Muslims’ feelings. That’s not what Trump is doing. Trump is equating Islam with terrorism,” said Kemal Kirişci, a Turkey expert at the Brookings Institution in Washington. “In retrospect,” he added, “Turkey may come to miss Obama.”