The leaders of Iran, Russia and Turkey met Wednesday for high-level talks on ending the Syrian war, cementing their influence on the outcome of the conflict and isolating the United States from the region’s most crucial diplomacy.

The three presidents — Recep Tayyip Erdogan of Turkey, Iran’s Hassan Rouhani and Russia’s Vladimir Putin — gathered in the Turkish capital, Ankara, where they pledged to cooperate on reconstruction and aid. They also vowed to protect Syria’s “territorial integrity,” even as all three nations maintain a military presence inside the country. The leaders called for more support from the international community and emphasized their opposition to “separatist agendas” in Syria.

“The future of Syria and our region cannot be left to a few terrorists,” Erdogan said at a news conference marking the end of the summit. Turkish troops have fought the Islamic State in Syria, as well as Kurdish militias, which Turkey sees as linked to Kurdish separatists at home.

“Without peace in Syria, there cannot be peace in Turkey,” he said. “There is a difficult road ahead.”

But the three nations conferred against a backdrop of rising tensions between them and the United States, which also maintains a military presence in Syria. It was the second time that Erdogan, Putin and Rouhani have met in recent months to discuss the conflict, underscoring those tensions and the extent to which U.S. power has waned in the region.

A senior administration official said Wednesday that President Trump has instructed military officials to prepare to withdraw U.S. troops from Syria. The president has not set a timetable for the move, the official said, but has stressed that U.S. troops can continue to train local forces that are protecting areas freed from the Islamic State.

If implemented, a U.S. departure would leave a power vacuum in parts of Syria, accelerating an already rapid scramble for influence and territory after seven years of conflict. It would also empower Iran and Russia, both U.S. adversaries and backers of Syrian President Bashar al-Assad, who has clung to power despite the ravages of civil war.

The conflict started in 2011 as a peaceful uprising but quickly morphed into an armed rebellion. Since then, nearly half a million Syrians have been killed and more than 11 million displaced, and the country has fractured into a patchwork of fiefdoms, many run by gunmen with shifting allegiances.

In the north and east, different areas are controlled by Turkish-backed rebels, al-Qaeda-linked militants and Kurdish militants supported by the United States. Elsewhere, a combination of Iranian proxies, Syrian government forces and Russian mercenaries hold sway.

Perhaps most striking, however, has been the rapid deterioration of relations between Turkey and the United States, both members of the NATO alliance, despite recent efforts on both sides. Turkey has faulted the Pentagon for cooperating with Kurds in Syria, known as the People’s Protection Units, or YPG. The United States has pushed back against Turkish threats to attack the northern Syrian city of Manbij, where U.S. and Syrian Kurdish forces ousted the Islamic State.

In the meantime, Turkey has strengthened its ties with Russia, including hosting Putin for talks ahead of Wednesday’s three-way summit. Turkey’s drift toward Russia has alarmed Western allies, despite their experience of years of friction with Ankara, and Erdogan’s decision to host two U.S. foes has served to highlight the animosity.

“With the vacuum the United States is leaving in the region, and also with the reckless and careless moves of the Trump administration — like completely disregarding the concerns of Turkey, completely spoiling all the communication channels with Russia — it will lead to the empowerment of these three major powers,” Ahmed al-Borai, an editor at TRT World, the English-language channel of Turkey’s state broadcaster, said Wednesday, referring to Iran, Russia and Turkey.

But even as the three countries converged in Ankara this week, their interests continue to diverge on the battlefield.

Turkey has long been an opponent of Assad and has supported the rebels opposed to his rule. But Russia, which backs Assad, has fought to quell the rebellion and maintain its military foothold in Syria. Iran has opposed Turkish operations in Syria and, analysts say, will support Assad at any cost.

“There are some real tensions between Turkey and Iran,” a Western diplomat said recently, speaking on the condition of anonymity because he was not authorized to speak about the conflict.

“Assad is probably the single most important individual in Iran’s projection of strength within Syria and beyond,” said the diplomat, whose work is focused on Syria. “I don’t think they would want to see any final political reform that endangers Assad’s position or weakens his government’s hold.”

Bijan Sabbagh contributed to this report.