Idlib is the last bastion of anti-government rebels, with fears growing in recent weeks about the likelihood of a devastating offensive by government forces.
President Vladimir Putin said the demilitarised zone will be established by 15 October, while Russian defence minister Sergei Shoigu said there will now be no new military operation against Syria’s Idlib by Syrian government forces and their allies.
“I believe that with this agreement we prevented a humanitarian crisis in Idlib,” Mr Erdogan said.
Russia, the biggest outside backer of Syrian President Bashar al-Assad in the country’s seven-year civil war, has been preparing for an offensive on Idlib, a city that is controlled by rebels and is home to about three million people.
But after Mr Putin’s talks with Turkish President Erdogan, who has opposed a military operation in Idlib, it has been agreed was that all heavy weapons be withdrawn from the buffer zone, and that what he called radically-minded Islamist fighters, would have to pull out of the zone.
The zone, he said, would be between 15km and 25km (9 to 12 miles) wide and would be patrolled by mobile units of Turkish and Russian troops.
It was not immediately clear if the demilitarised zone incorporated the city of Idlib itself; if it did, that would require that some of the rebels pull out of the city.
Ahead of the trip to Russia, Mr Erdogan had said Turkey’s calls for a ceasefire in Idlib region were bearing fruit after days of relative calm but that more work needed to be done.
Mr Putin publicly rebuffed a proposal from Mr Erdogan for a ceasefire there when the two met along with Iran’s president for a three-way summit in Tehran earlier this month.
Syria’s ambassador to the United Nations in Geneva, speaking earlier on Monday, said the Assad government was determined to drive Islamist fighters, including Jabhat al-Nusra , which he described as 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 cooperation with UN humanitarian agencies,” Ambassador Hussam Edin Aala told the UN Human Rights Council in Geneva.