Russian President Vladimir Putin and his Turkish counterpart Recep Tayyip Erdogan met Wednesday to coordinate their moves in Syria as their governments bargain over zones of influence in the war-torn country.

The leaders share strong opposition to the U.S. military presence in Syria, seeing it as an obstacle to their clout in the country. The Kremlin meeting marked their first encounter since U.S. President Donald Trump announced the pullout of American troops in a Dec. 19 tweet.

“If such plans are implemented, it will mark a positive move that would help stabilize the situation,” Putin said about the planned U.S. withdrawal.

Putin emphasized Moscow’s readiness to respect Turkey’s interests, but encouraged it to talk to the Syrian government to help stabilize the border areas.

Turkey has pushed for the creation of a 32-kilometer (20-mile) “safe zone” in northeastern Syria to ensure that the Syrian Kurdish militia – The People’s Protection Units, or YPG, which Turkey considers to be a “terrorist group” for its ties to outlawed Kurdish rebels inside Turkey – is kept away from the Turkish border.

The YPG is the main component of the Syrian Democratic Forces that rolled back the Islamic State group from wide parts of Syria with the help of the U.S.-led coalition.

“It is of critical importance that a power vacuum that can be abused by terror groups does not emerge during the process of the U.S. withdrawal,” Erdogan said.

The Turkish leader noted that the U.S. has given positive signals regarding the “safe zone” and added that “there is no problem between us and Russia” in creating it.

“I have stated that our only aim is our duty to clear (the region) of terror organizations such as the PYD and the YPG, and especially of Daesh,” Erdogan said, referring to the Kurdish militia group’s political arm and IS.

Putin, however, used the meeting to reaffirm Moscow’s support of contacts between Syrian President Bashar Assad’s government and the Kurds.

“Such dialogue will help consolidation of the Syrian society and the national reconciliation,” Putin said. “It will be beneficial not only to Syria but its neighbors.”

Russia says it expects Assad’s government to take over Kurdish-held border regions east of the Euphrates River following the planned U.S. troop withdrawal from the area, which Turkey objects to.

Turkey fears any deal between the Syrian government and the YPG in the border area as well as in the strategic town of Manbij, under which the Kurdish militia would remain a threat to Turkey’s security.

Putin signaled Russia’s willingness to accommodate Turkish security concerns, seeing strong ties with Turkey as an essential counterbalance to U.S. influence in the region.

“We respect the interests of our Turkish friends in ensuring security,” Putin said.

But at the same time, he encouraged Turkey to use a 1998 treaty with Syria to help ensure border security.

Russia appears eager to sponsor Damascus’ talks with the Kurds in the hope that it would extend the Syrian government’s gains and further cement its hold on the country. The U.S. plan to withdraw has further bolstered Russia’s role as the top power broker in Syria.

Syrian pro-government paper Al-Watan reported Tuesday that a Kurdish delegation arrived in Moscow a day before Erdogan. There was no independent confirmation yet from Kurdish officials.

Putin and Erdogan called each other “dear friend,” hailing the close ties between their countries and their importance for regional security. They were accompanied by a retinue of security and military officials for detailed discussions on Syria.

Russia and Iran have helped Assad to win back control of most of the country, while Turkey has backed Assad’s foes during the nearly eight-year conflict. Despite that, the three countries have teamed up to broker a peace deal for Syria, united by their shared desire to undercut the U.S. clout in the region.

The agreement is now tested by Trump’s abrupt decision to withdraw from Syria, leaving Moscow, Ankara and Tehran jockeying for influence in the country.

Russian and Turkish interests also collide in the northwestern province of Idlib, which is packed with 3 million people, including many who were displaced from other parts of the country.

Last September, Putin and Erdogan struck a de-escalation deal on Idlib that averted the Syrian army offensive that sparked fears of a humanitarian catastrophe. The agreement created a security zone free of heavy weapons and monitored by Turkish troops to halt fighting.

Turkey is pushing for that deal to stay in place, fearing the Syrian government forces are trying to undermine the agreement.

Russia, in its turn, has urged Turkey to act more resolutely in reining in militants in Idlib who have launched attacks on Syrian government forces and the Russian military.

Putin praised Turkey for helping stabilize Idlib, but emphasized that more joint efforts are needed to combat militants.

“The cessation of hostilities mustn’t hurt the fight against terrorism that should continue,” the Russian leader said.

“Our fight against terror organizations in Idlib will continue jointly in the same way,” Erdogan said.

Both leaders boasted of their effort to produce a list of candidates for a committee that would work out Syria’s new constitution. Putin noted that its approval by the United Nations has been blocked by France, Germany and Britain, voicing hope that a compromise will be found.