Syrian and Russian forces will deploy in northeast Syria to remove Kurdish YPG fighters and their weapons from the border with Turkey under a deal agreed on Tuesday which both Moscow and Ankara hailed as a triumph.
The agreement expands on a U.S.-brokered truce which expired on Tuesday and underlines the dizzying changes in Syria since U.S. President Donald Trump announced a U.S. troop withdrawal two weeks ago ahead of Turkey's cross-border offensive.
Tuesday's deal endorses the return of Syrian President Bashar al-Assad's forces to the border alongside Russian troops, replacing the Americans who had patrolled the region for years with their former Kurdish allies.
Under the agreement between Russian President Vladimir Putin and Turkish President Recep Tayyip Erdogan, the two countries said Russian military police and Syrian border guards would start removing the YPG 30 km (19 miles) from the Turkish border on Wednesday.
Six days later, Russian and Turkish forces will jointly start to patrol a narrower, 10 km strip of land in the "safe zone" that Ankara has long sought in northeast Syria.
After six hours of talks with Erdogan in the Black Sea resort of Sochi, Putin expressed satisfaction at decisions he described as "very important, if not momentous, to resolve what is a pretty tense situation which has developed on the Syrian-Turkish border."
A senior Turkish official described it as an "excellent" deal which would achieve Turkey's long-held goal of a border strip cleared of the YPG, which Ankara regards as a terrorist organization because of its links to insurgents inside Turkey.
Last week's U.S.-brokered deal, which technically expired at 1900 GMT on Tuesday, was limited the central part of the border strip between the Syrian towns of Tel Abyad and Ras al Ain, where Turkish forces had focused their military offensive.
Under the deal with Moscow, the length of border which the YPG would be required to pull back from is more than three times the size of the territory covered by the U.S.-Turkish accord, covering most of the area Turkey had wanted to include.
"The outcome of the Putin-Erdogan meeting in Sochi today indicates that Erdogan has become a master of leveraging the U.S. and Russia against each other to maximize Ankara's gains," Soner Cagaptay, director of the Turkish program at the Washington Institute said in a tweet.
"Turkey got the safe zone it wanted all this time."
U.S. Vice President Mike Pence, who helped negotiate the five-day ceasefire last Thursday, received a letter from the commander of the Kurdish-led Syrian Democratic Forces (SDF), saying their forces had withdrawn under that deal.
"Today the Vice President received a letter from General Mazloum (Kobani) notifying him that all SDF forces have withdrawn from the relevant area of operations," said Pence spokeswoman Katie Waldman. "The Vice President welcomes this development and sees it as having satisfied the terms of the 17 October agreement, as pertains to the withdrawal of the YPG."
An official from the Syrian Democratic Forces, which includes YPG fighters, later said the SDF commander "confirms that the SDF have withdrawn from ceasefire zone."
Before flying to Russia for the talks Erdogan had said hundreds of Kurdish fighters remained near to Syria's northeast border despite the truce demanding their withdrawal.
After the Sochi talks, Turkish broadcaster NTV quoted Erdogan as saying the United States "has not fully kept its promises" under last week's temporary truce.
The U.S. withdrawal from northern Syria has been criticized by U.S. lawmakers, including some of Trump's fellow Republicans, as a betrayal of Kurdish allies who have helped the United States fight Islamic State in Syria.
Trump said on Monday it appeared that the five-day pause was holding despite skirmishes, and that it might go past Tuesday's expiry, but Erdogan earlier had said the fighting may resume.
"If the promises given to us by America are not kept, we will continue our operation from where it left off, this time with a much bigger determination," he said before the Sochi agreement was struck.
Turkey sought a "safe zone" along 440 km (275 miles) of border with northeast Syria, but its assault focused on the two border towns in the centre of that strip, Ras al Ain and Tel Abyad.
Syrian and Russian forces have already entered two border cities, Manbij and Kobani, which lie within Turkey's planned "safe zone" but to the west of Turkey's military operations.
Erdogan has said he could accept the presence of Syrian troops in those areas, as long as the YPG are pushed out.
Russia is a close ally of Assad. Turkey has backed rebels seeking to oust Assad during Syria's more than eight-year-long civil war but has dropped its once-frequent calls for him to quit.
Ankara is holding covert contacts with Damascus, partly via Russia, to avert direct conflict in northeast Syria, Turkish officials say, although publicly the two governments remain hostile.
"Erdogan is a thief and is now stealing our land," Assad said during a rare visit to a separate frontline in Syria's northwestern Idlib region, the last major bastion of Turkey-backed rebels.
Some 300,000 people have been displaced by Turkey's offensive and 120 civilians have been killed, according to the Syrian Observatory for Human Rights, a UK-based war monitor. It said on Sunday 259 fighters with the Kurdish-led forces had been killed, and 196 Turkey-backed Syrian rebels. Turkey says 765 terrorists but no civilians have been killed in its offensive.