Turkey will send more troops into Syria's Idlib province after striking a deal with Russia that has averted a government offensive and delighted rebels who say it keeps the area out of President Bashar al-Assad's hands.
The deal unveiled by Russian President Vladimir Putin, Assad's most powerful ally, and Turkish President Tayyip Erdogan on Monday will create a new demilitarized zone from which "radical" rebels must withdraw by the middle of next month.
Damascus also welcomed the agreement but vowed to continue its efforts to recover "every inch" of Syria. Iran, Assad's other main ally, said "responsible diplomacy" had averted a war in Idlib "with a firm commitment to fight extremist terror".
The agreement has put a halt to a threatened Syrian government offensive. The United Nations had warned such an attack would create a humanitarian catastrophe in the Idlib region, home to about 3 million people.
The Idlib region and adjoining territory north of Aleppo represents the opposition's last big foothold in Syria. Assad has recovered most of the areas once held by the rebels, with decisive military support from Iran and Russia.
But his plans to recover the northwest have been complicated by Turkey's role on the ground: it has soldiers at 12 locations in Idlib and supplies weapons to some of the rebels.
Erdogan had feared another exodus of refugees to join the 3.5 million already in Turkey, and warned against any attack.
In striking the deal, Russia appears - at least for now - to have put its ties with Turkey ahead of advancing the goal of bringing all Syria back under Assad's rule.
That goal is also obstructed by the presence of U.S. forces in the quarter of Syria east of the Euphrates which is held by an alliance of Kurdish and Arab militias, and at a base near the borders with Jordan and Iraq.
Analysts cautioned that implementation of the deal faced big challenges, notably how to separate jihadists from other rebels - a goal Ankara has been struggling to achieve for some time.
Turkish Foreign Minister Mevlut Cavusoglu said the "moderate opposition" would keep its weapons and the "region will be cleared of radicals". Turkey would "make additional troop deployments" and its 12 observation posts would remain.
The deal was "very important for the political resolution in Syria". "If this (Idlib) had been lost too, there would be no opposition anymore," he said.
Mustafa Sejari, a Free Syria Army (FSA) official, said the deal "buries Assad's dreams of imposing his full control over Syria".
Yahya al-Aridi, spokesman for the opposition Syrian Negotiations Commission expressed hope that a government offensive was now off the table for good.
The Syrian government, in a statement published by state media, said it welcomed any agreement that spared blood. It also said the deal had a specific timeframe which it did not detail.
"I see it as a test of the extent of Turkey's ability to implement this decision," Ali Abdul Karim, Syria's ambassador to Lebanon, said in an interview with Lebanon's al-Jadeed TV. "We do not trust Turkey ... but it's useful for Turkey to be able to carry out this fight to rid these groups from their weapons."
Moscow said the deal "confirmed the ability of both Moscow and Ankara to compromise ... in the interests of the ultimate goal of a Syrian settlement by political and diplomatic means".
"Is this merely a stay of execution? Or is it the beginning of a reprieve?" U.N. aid chief Mark Lowcock asked during a monthly meeting of the U.N. Security Council on Syria.
The demilitarized zone will be monitored by Russian and Turkish forces, the countries' leaders said.
But neither Russia nor Turkey have explained how they plan to differentiate "radically-minded" rebels from other anti-Assad groups. It was also not immediately clear how much of the city of Idlib fell within the zone.
Putin said the decision was to establish by Oct. 15 a demilitarized area 15–20 km (10-12 miles) deep along the contact line between rebel and government fighters.
Naji Abu Hufaiza, spokesman for the National Front for Liberation said he did not have details of the agreement, but said that while he saw it as a success for Turkish diplomacy, his group did not trust Russia to uphold it.
Idlib is held by an array of rebels. The most powerful is Tahrir al-Sham, an amalgamation of Islamist groups dominated by the former Nusra Front - an al Qaeda affiliate until 2016.
Other Islamists, and groups fighting as the Free Syrian Army banner, are now gathered with Turkish backing under the banner of the "National Front for Liberation".
The area is also the last major haven for foreign jihadists who came to Syria to fight the Alawite-led Assad government.
Putin said that, at Erdogan's suggestion, by Oct. 10, all opposition heavy weapons, mortars, tanks, rocket systems would also be removed from the demilitarized zone.
Sinan Ulgen, a former Turkish diplomat and analyst at Carnegie Europe, said it was unclear how Turkey and Russia would be able to separate radical fighters from other rebels.
The hope is that Syrians "will be more inclined to be part of a demilitarization effort" while foreign fighters "have nowhere to go", he said.
Earlier this month, Putin publicly rebuffed a proposal from Erdogan for a truce when the two met along with Iran's president at a summit in Tehran. Iran also welcomed the agreement.