Turkey and Russia on Monday agreed to create a demilitarised buffer zone in Syria's Idlib province to separate government troops from rebel forces, with Turkish and Russian soldiers patrolling the zone to ensure it is respected.
However, within hours of the agreement, missiles were fired at the government-held port of Latakia, with Syrian state media reporting that air defences had brought down the projectiles. Initial indications suggested that the bombardment against Latakia had come from the sea, and there were also unconfirmed reports that other parts of the country had also been attacked.
Russian president Vladimir Putin, speaking after talks with his Turkish counterpart Tayyip Erdogan, said the agreement was that all heavy weapons be withdrawn from the zone, and that "radically minded" rebels, including the militant group Hayat Tahrir Al Sham (HTS), would have to pull out of the zone.
The zone will be 15-20km deep along the front between the rebels and regime troops and will be in place by October 15, Mr Putin said after the talks in the Russian city of Sochi.
The weaponry to be withdrawn includes tanks, multiple-launch rocket systems and rocket launchers belonging to all armed groups, he said.
Russia Defence Minister Sergei Shoigu said the agreement meant there would be no new military operation against Idlib by Syrian government forces and their allies.
The planned regime assault on Idlib had raised fears of a humanitarian catastrophe, with more than 3 million people living in the last remaining rebel-held province after seven years of civil war.
On Tuesday, Syria's ambassador to Lebanon said that the deal on Idlib would be a test of Ankara's ability back up its commitments with action.
"I see it as a test of the extent of Turkey's ability to implement this decision... They are under pressure now and I believe they will try", Ali Abdel Karim told Lebanon's Al Jadeed TV.
Turkey, a supporter of some rebel groups, was at odds with Russia and Iran, allies of Syria President Bashar Al Assad, which insisted that the regime should retake all its territory. The three countries agreed last September to make the province one of four de-escalation zones in Syria, with Turkey setting up 12 military outposts to enforce the pact.
However, with the other areas reclaimed in a series of Russian-backed regime offensives over the past year, Mr Al Assad and his allies were determined to take control of Idlib as well.
Mr Putin said Monday's agreement had the backing of the Syrian regime. “Overall, this approach has the support of the Syrian Arab Republic. It will help peace to return to Syrian soil,” he said.
“I believe we’ve prevented a major humanitarian crisis,” Mr Erdogan said.
The question of whether the rebel groups will comply with the agreement remains open.
Charles Lister, senior fellow and director of the extremism and counter-terrorism programme at the Middle East Institute, suggested it would give Turkey more time to break up the HTS and isolate the hardcore elements.
"More than anything, this gives Turkey more time (and more leverage) to manipulate conditions in Idlib and to further exacerbate HTS's internal divisions and work towards separating acceptable / irreconcilable," he wrote on Twitter.
Turkey supports a rebel coalition in Idlib called the National Front for Liberation but about two-thirds of the province is under the control of HTS, whose fighters make up about 10,000 of an estimated 60,000 rebels in Idlib.
The agreement puts HTS in a dilemma as it would face pressure from Turkey and its rebel allies if it resists, while complying would "spark an internal crisis threatening the continuity of the group", Mr Lister said, calling it a "smart move" by Ankara and a patient one by Moscow.
The civilian and fighter population of the province has been swollen by a series of surrender deals imposed by the regime after recapturing other areas of Syria, under which rebels and residents who refused to submit to government authority were sent to Idlib.
Mr Erdogan had been pushing for an alternative to an all-out assault in the province that he said would lead to a "bloodbath" and send scores of civilians fleeing towards the border with Turkey.
Mr Putin and Iranian President Hassan Rouhani rebuffed his call for a ceasefire at a summit in Tehran on September 7, which was followed a day later by heavy Russian and regime bombardment in Idlib, raising fears that a regime attack was imminent.
However, the bombardment was followed by a week of relative calm. Mr Erdogan said before leaving for Sochi that Turkey's calls for a ceasefire were bearing fruit but that more work needed to be done.
Turkey's military has also been sending reinforcements into Idlib in recent weeks in a bid to deter an attack. Tanks and other hardware mae up a convoy of 50 military vehicles which were sent over the border on Sunday, according to the Hurriyet daily.
Syria's ambassador to the United Nations in Geneva, speaking earlier on Monday, said the Assad government was determined to drive HTS, which Turkey recently designated a terrorist organisation, from Idlib.
"Our government wants to give priority to reconciliation and to give all necessary measures in order to ensure safe corridors, and to secure the lives of civilians and to provide the basic needs of civilians in co-operation with UN humanitarian agencies," Ambassador Hussam Edin Aala told the UN Human Rights Council in Geneva.