Erdogan and Putin are shaking hands / REUTERS

Turkey and Russia agreed a ceasefire deal on Thursday in Syria's Idlib region, their two leaders said after lengthy talks in Moscow to contain a conflict which has displaced nearly a million people in three months.

Russian President Vladimir Putin, standing next to his Turkish counterpart Tayyip Erdogan, said he hoped their agreement would lead to a halt of military action in Syria's last rebel stronghold in the far northwest of the country, Reuters said.

Read alsoRussia committed war crimes in Syria – UN report

Видео дня

"I express hope that these agreements will serve as a good basis for a cessation of military activity in the Idlib de-escalation zone (and) stop the suffering of the peaceful population and the growing humanitarian crisis," Putin said.

Erdogan told reporters the truce would come into effect at midnight on Thursday. "We will work together to supply aid for the Syrians in need," he said, adding that Turkey retained the right "to respond to all (Syrian) regime attacks in the field."

Russia and Turkey back opposing sides in Syria's nine-year conflict, with Moscow supporting President Bashar al-Assad and Turkey backing some rebel groups. They have in recent years reached several ceasefire deals in Idlib which have collapsed.

Russian air strikes have propelled an offensive by Assad's forces in Idlib that sparked what the United Nations says may be the worst humanitarian crisis yet in a war that has driven millions from their homes and killed hundreds of thousands.

The Russian military has, however, repeatedly played down any talk of a refugee crisis and accused Turkey of violating international law by pouring enough troops into Idlib to make up a mechanised division.

Turkey, which has the second largest army in the transatlantic NATO alliance, has funnelled troops and equipment into the region in recent weeks to resist the Syrian government advance and prevent a wave of refugees over its southern border.

Russia also raced to reinforce its troops in Syria by sea and air before the Putin-Erdogan talks.

The Kremlin said the two leaders had spoken for three hours on their own before being joined by their officials.

The two leaders also agreed to establish a secure corridor near the M4 highway, which runs east to west through Idlib, and hold joint patrols along the road from March 15.

In a joint statement read out by the Turkish and Russian foreign ministers, the two sides said the corridor would stretch 6 km to the north and 6 km to the south of the M4 – effectively advancing Russia's presence further north into Idlib.

They said their defense ministers would agree on the parameters of the corridor within seven days.