ISTANBUL — In their recent encounter at the NATO summit meeting, President Recep Tayyip Erdogan of Turkey and President Trump gave each other a fist-bump, as Mr. Trump declared, “I like him, I like him.”
The love fest was short-lived. Days later, the Trump administration imposed financial sanctions against two ministers of Mr. Erdogan’s cabinet, sending the Turkish lira plummeting and a stream of nationalist invective pouring forth from the Turkish media. Mr. Erdogan retaliated last weekend with sanctions of his own against his ministers’ American counterparts.
The tit-for-tat exchange has led many to fear that the longtime allies were headed toward an irreparable rift, driven by two leaders who each pride themselves on driving a hard bargain, in this case over Turkey’s detention of an American pastor, Andrew Brunson, who was swept up in Mr. Erdogan’s sweeping crackdown after a failed coup in 2016 and accused of espionage.
Combative politics is written in Mr. Erdogan’s DNA, one Turkish columnist explained, and for that matter, it seems, in Mr. Trump’s. Indeed, according to diplomats, the several phone calls that have taken place between the two men this year have been stormy.
In the nationalistic mood of the moment, many Turks have even applauded Mr. Erdogan’s riposte.
Across the spectrum, Turkish politicians, despite their deep divisions, took a united front against the United States for freezing the assets of the Turkish interior and justice ministers last week.
Most of the opposition parties in the Parliament condemned the United States sanctions in a joint statement, and the Chambers of Commerce and Industry and other business organizations denounced the sanctions by the United States.
The Ceyhan municipal council, in Turkey’s southern province of Adana, announced that it had revoked its sister-city status with Frisco, Tex., because of the dispute.
Supporters of Mr. Erdogan took to Twitter with the hashtag #Emperyalizmeköleolmayacağız (#We will not be slaves to imperialism), even while acknowledging that the political crisis will not help an already souring economy.
“I have my own company and dollar affects almost our entire business,” said a Twitter post by Erkan Babur, an engineer from Tokat, a province in the Black Sea region, and a local executive member of the right-wing Nationalist Movement Party. “But we are not born as bosses from our mothers. And it is not the dollar that made us the boss.”
“We will close down our company if necessary and paint shoes, sell bagels, thanks to God, but never make Turkey bait for you,” he added.
Newspapers, most of them now under control of businessmen close to the president, took fiercely anti-American stances as well.
“Know your limits, U.S.,” said one headline in the daily Milliyet. Even the newspaper Sözcü, an aggressive nationalist opponent of Mr. Erdogan, called on the government not to bow its head. “Stand tall, that’s enough for us,” one headline read.
Even before Mr. Erdogan ordered matching sanctions on Saturday against two American officials, some analysts had predicted that he would escalate the dispute.
Soner Cagaptay, the director of the Turkish Research Program at the Washington Institute for Near East Policy, predicted an “irrational response from Ankara.”
“Half of Turkey, including many in Erdogan’s circles, has drunk the Kool-Aid and believes that Erdogan is under attack (by his domestic and foreign adversaries) because he’s out to make Turkey great again,” Mr. Cagaptay wrote in a text message.
Kemal Can, writing in the opposition newspaper Cumhuriyet, said much of the dispute was driven by Mr. Erdogan’s personal style.
“Sometimes a cunning tradesman, sometimes a stubborn toughness, sometimes glowering, sometimes bowing, but always with confidence that he would make it happen in the end,” Mr. Can wrote. “A mental state manages this style that Erdogan himself strongly believes in as he molds his close circle around the same religious belief.”
Mr. Erdogan’s propensity to surround himself with yes-men may have led him to misjudge domestic politics in the United States and miscalculate how far he could push Washington, he and others said.
“It is the thinking that ‘we are so valuable that America is not going anywhere,’” said Ahmet Kasim Han, associate professor in international relations at Kadir Has University in Istanbul.
Not only is it wrong, but dangerous, Mr. Han said. “This leads to an escalation that becomes very hard to control and it can really lead to a point where it can all break up.”
The combination of the personalities of Mr. Erdogan and Mr. Trump leave everyone guessing as to the outcome, Asli Aydintasbas, a fellow of the European Council on Foreign Relations, raised the in a column on its website.
“It is possible that, in seven or eight months, Brunson will be sitting in his home in North Carolina, Atilla will be back in Turkey, and Trump will be raving about Erdogan on Twitter once again,” Ms. Aydintasbas wrote, describing a proposed deal to exchange the pastor for Mehmet Hakan Atilla, a Turkish banker convicted by an American court.
“But it is also possible that Turkey will become the next Venezuela, clashing with the West and dealing with a dire economic downturn,” she added. “No one can be sure.”
Yet Mr. Erdogan, some analysts pointed out, can also be pragmatist, capable of conducting an about-face on policy when it suits him.
Officials close to him have continued to offer assurances that an agreement would be found. Foreign Minister Mevlut Cavusoglu has repeated that negotiations were continuing, and reports surfaced Tuesday that a Turkish delegation would travel to Washington within days.
Berat Albayrak, the finance and treasury minister and also the son-in-law of Mr. Erdogan, expressed confidence in a television interview on Friday. “Ties would never break,” Mr. Albayrak said, likening the dispute to an argument within a family.
“Even two siblings in the same household cannot agree on the same issue,” he said. “Wife and husband, partners of 40 years long cannot agree on everything. They sometimes argue and then they make peace.”
His comments were intended to calm the financial markets which have suffered losses in the last week since the United States announced the sanctions.
Sedat Ergin, a former Washington correspondent for the newspaper Hurriyet who has followed American-Turkish relations for more than 40 years, suggested that damage control for the economy would be Mr. Erdogan’s priority.
He described the current crisis as the worst he had seen since the weapons embargo over Cyprus by the United States against Turkey 40 years ago.
“It feels like a journey back in time,” Mr. Ergin wrote in a column for Hurriyet Daily News over the weekend.
Both sides were to blame, he said. Turkey did not grasp the grievances that Mr. Brunson’s case caused to the United States. And Washington, he said, had made no progress on the extradition of Fethullah Gulen, who is accused of instigating the 2016 failed coup, and it had disregarded Turkey’s security concerns in Syria for far too long.
The relationship would not be easily mended, he said. “There is no magic wand to solve this deadlock with a single touch,” he wrote. “Perhaps, it will be best for both sides to put this relationship on ice for a while.”
Yet he also saw signs that Mr. Erdogan may yet want a deal.
The president’s language, Mr. Ergin wrote, was carefully measured, he expressed the wish that an agreement on the Syrian town of Manbij remain in place, and he made an unusual appeal that was clearly a message to Mr. Trump, the businessman.
Mr. Erdogan complained that some around Mr. Trump were causing the problems by imposing sanctions and “beating the grape grower,” while he was for cooperating so both parties could enjoy “eating the grapes.”
“Always, everywhere, we are on the side of ‘win-win’ politics,” Mr. Erdogan declared. “We are for every kind of cooperation to eat the grapes. But we will never give the opportunity to those whose aim is to beat the grape grower.”