"Relative" calm has been reported around the conflict-shattered Syrian region of Idlib soon after a ceasefire between Russia and Turkey came into force at midnight on Friday local time, according to the British-based the Syrian Observatory for Human Rights war monitor said.

Turkey and Russia have agreed to halt fighting in northern Syria that has sparked a humanitarian disaster and raised fears of their armies clashing, with a ceasefire due to take effect within hours.

After more than six hours of talks in Moscow, Russian President Vladimir Putin and Turkish counterpart Recep Tayyip Erdogan agreed on the ceasefire.

The agreement will also create a security corridor along the key M4 highway in northern Syria, where Turkish and Russian forces will launch joint patrols from 15 March .

The deal aims to put a stop to intense fighting in Idlib, the northwestern province of Syria where Turkey is battling Russian-backed government forces.

Nearly a million civilians have fled their homes due to the violence and dozens of Turkish soldiers have been killed.

The Britain-based Observatory reported that Russian and Syrian air strikes had halted but said there was "artillery fire... by Syrian regime forces on the positions of insurgent groups" in areas controlled by jihadists in parts of Aleppo and Hama bordering Idlib province in northwestern Syria. 

Earlier Mr Putin told a joint press conference after the talks that the agreement would "serve as a good basis for ending fighting" in Idlib and for "stopping the suffering of the civilian population".

"The object is to avoid the humanitarian crisis getting worse," Mr Erdogan said, though he added that Turkey reserved the right to "retaliate with all its strength against any attack" by Syrian forces. 

The situation in Idlib, the last rebel stronghold in Syria's nine-year civil war, had become critical as Turkey for the first time launched a direct offensive against President Bashar al-Assad's forces.

Turkey has long backed certain rebel groups against Mr Assad but its priority now is to stop an influx of refugees among those fleeing an offensive the regime has been pressing on Idlib since December.

Turkey has demanded the European Union support its actions in Syria and last week opened its border with EU member Greece to migrants - a move decried by some in the bloc as "blackmail".

Despite supporting opposing sides in the war, Russia and Turkey have worked to try to resolve the conflict and avoid direct confrontation.

The two countries agreed a deal in the southern Russian city of Sochi in 2018 that created a "de-escalation" zone in Idlib and allowed for the deployment of 12 Turkish observation posts.

In the run-up to these talks, the two sides had traded accusations of violating the deal.

Turkey said Russia was not fulfilling part of the agreement that guaranteed no attacks on Idlib and the status quo on the ground.

In turn Russia said Turkey was breaching the agreement by supporting "illegal armed groups" and accused Turkish forces of mingling with "terrorists" in Idlib.

Turkey officially declared an operation against the Assad government over the weekend, after 34 Turkish soldiers died in an air strike blamed on Damascus.

It has since downed three Syrian warplanes and killed dozens of soldiers and allied fighters, according to monitors.

Two more Turkish soldiers were killed by Syrian regime fire in Idlib, the defence ministry said, just hours before the ceasefire was due to take effect.

The deal leaves open the fate of the Turkish observation posts in Idlib, which have been surrounded since Damascus launched its offensive.

But it does mark the first time Russian and Turkish forces will operate jointly in Idlib. 

The security corridor along the M4 highway, which connects second city Aleppo to the coast through Idlib, will run six kilometres deep both north and south of the highway. 

The joint Russian-Turkish patrols will operate between the town of Tronba in Idlib and a village in Latakia province, a regime stronghold.

Fighting continued elsewhere in Idlib on Thursday, with Russian air strikes killing at least 15 civilians gathered outside the town of Maaret Misrin, the Syrian Observatory for Human Rights monitoring group said.

Mr Erdogan warned Europe yesterday that it must support Turkey's "political and humanitarian solutions in Syria" if it wants to avoid a repeat of the 2015 migration crisis.

Thousands of migrants have massed at the Turkish-Greek border since Mr Erdogan gave them the green light to try to enter Europe, leading to clashes with Greek police.

Turkey hosts roughly 3.6 million refugees from Syria - and hundreds of thousands from elsewhere - and Mr Erdogan's move has sparked concern in Europe of a renewed influx of migrants.