Trump welcomed Erdogan, fresh off a narrow electoral victory that granted him wide-ranging new powers, to Washington just a week after the Pentagon announced a plan to directly arm Kurdish militiamen in Syria for the first time.
While Erdogan's government had long warned U.S. officials against expanding support for the People's Protection Units (YPG), empowering a group Turkey sees as an existential threat, the warm public remarks from both leaders reflect the NATO allies' need to hold together a key partnership at a time of intense strain.
Aaron Stein, a Turkey scholar at the Atlantic Council, said the modest goals for Erdogan's two-day visit reflected the constraints of a relationship that has generated friction on both sides but that both nations cannot afford to jettison.
It was "mission accomplished, if your expectations are that you want people who are smiling in the photographs," he said.
For the United States, Turkey has been a key ally in the Middle East. Most recently, the use of Turkish military facilities has been critical in the U.S. campaign against the Islamic State in Syria. For Ankara, the backing of NATO's most powerful member has been an important boost as Turkey has asserted itself on the world stage.
In a reflection of those mixed sentiments, Erdogan heaped praise on his host — saying Trump had presided over a "legendary triumph" after last year's elections — but reiterated his objections to the U.S. partnership with the YPG.
"We should never allow those groups to manipulate the religious structure and the ethnic structure of the region, making terrorism as a pretext or an excuse," he said. Turkey views the YPG and the Democratic Union Party (PYD), the political wing of the same organization, to be an extension of the Kurdistan Workers' Party (PKK), a Turkish group that Ankara and Washington have labeled a terrorist movement.
"Taking YPG and PYD into consideration in the region will never be accepted and it is going to be against a global agreement that we have reached," Erdogan said.
While U.S. military officials have acknowledged Turkey's concerns, they say they have little choice in backing the YPG, the most effective fighting force they have been able to recruit in their bid to dislodge the Islamic State from Raqqa, the Syrian city that is the militants' de facto capital.
Erdogan also made reference to another of the issues creating friction in U.S.-Turkish ties: Fethullah Gulen, the Turkish cleric who lives in self-imposed exile in Pennsylvania, whom Erdogan has accused of plotting a coup attempt last July.
Turkish officials have repeatedly asked the United States to extradite Gulen, who oversees a vast educational and religious network in Turkey, over his suspected involvement in that episode.
The Justice Department must decide if Turkey has a case; if it does so, a federal court would then rule on extradition. So far, despite Turkey's submission of what it says is voluminous evidence, Justice has made no determination.
In an opinion piece published in The Washington Post on Tuesday, Gulen denied any involvement in the coup attempt.
Turkey has issued threats on the U.S. stance on Gulen and the YPG, saying future ties would hinge on its extradition request, and more recently saying it would take further military action against Kurdish militiamen if the United States provides new support.
The official visit was also an opportunity for the Trump administration to demonstrate its backing for Erdogan, who faces growing criticism for his government's crackdown against an array of perceived opponents, including the arrest of tens of thousands of people from the media, military and judiciary.
On Tuesday, dozens of people demonstrating for and against Erdogan's visit clashed outside the Turkish ambassador's residence in Washington. Nine people were injured and two were arrested, D.C. police said.
In the latest sign of his administration's reluctance to publicly criticize allies on matters of human rights, Trump made no mention of those issues.
Erdogan expressed optimism that his visit would mark an improvement in U.S.-Turkey ties.
"President Trump's recent election victory has led to the awakening of a new set of aspirations and expectations and hopes in our region," he said. "We know that by the help of the new U.S. administration, these hopes will not be lost in vain."
Karen DeYoung, Victoria St. Martin and Martin Weil contributed to this report.