The Syrian government and rebel groups have agreed to a ceasefire from midnight (22:00 GMT) across the country, followed by peace talks.
The deal was announced by Russian President Vladimir Putin and confirmed by the Turkish foreign ministry.
Russia and Turkey, which back opposing sides in the bitter conflict, will act as guarantors.
Turkey said all fighting including air strikes would be halted. However, some jihadist groups are excluded.
The Syrian army said in a statement that so-called Islamic State (IS) and Jabhat Fateh al-Sham (formerly the Nusra Front) “and the groups affiliated to them” were excluded.
But a rebel source quoted by Reuters news agency said only IS areas were not covered by the truce.
The ceasefire reportedly does cover the rebel-held Eastern Ghouta area near Damascus, which had been a sticking-point in negotiations.
Earlier this month, Moscow and Ankara negotiated a ceasefire in Syria’s second city, Aleppo, that led to tens of thousands of rebel fighters and civilians being evacuated from an enclave besieged by government forces.
Previous ceasefire initiatives this year brokered by the UN, or the US acting with Russia, quickly collapsed.
The Turkish foreign ministry said it was crucial for all states with influence over the groups in Syria to comply with and to support the ceasefire.
That could be seen as an obvious plea to Washington, among others, the BBC’s Selin Girit reports.
‘Fragile’ deal
Mr Putin announced in Moscow that three documents had been signed:
An agreement between the Syrian government and the armed opposition on a ceasefire
Measures for overseeing the ceasefire
An agreement to start peace talks
He described the deal as “fragile” but he praised the agreements as the result of the work of Russia’s defence and foreign ministries with Moscow’s partners in the region.
He added that he agreed with a proposal by the defence ministry to reduce Russia’s military presence in Syria but made it clear Moscow would “continue fighting international terrorism and supporting the Syrian government”.
A spokesman for the Syrian opposition National Coalition told AFP news agency it backed the ceasefire.
“The National Coalition expresses support for the agreement and urges all parties to abide by it,” Ahmed Ramadan said.
Speaking before the agreement was reached, Diana Darke, a Middle East expert, said she was optimistic as Russia and Iran had achieved their war goals.
“Potentially everybody has finally reached the stage where they are ready,” she told the BBC World Service’s Newsday programme.
“They can see that there is nothing further to be gained. I mean Russia does not want to be sucked more and more in to the Syrian quicksand. They’ve got what they wanted. The same for Iran. The Syrian government itself is incredibly weak.”
Join GhanaStar.com to receive daily email alerts of breaking news in Ghana. GhanaStar.com is your source for all Ghana News. Get the latest Ghana news, breaking news, sports, politics, entertainment and more about Ghana, Africa and beyond.