The Syrian government and rebel groups have agreed a nationwide ceasefire from midnight local time (22:00 GMT) on Thursday, 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, will act as guarantors.
The rebel High Negotiations Committee (HNC), seen by the UN as the main opposition group, confirmed the deal, which excludes jihadist groups.
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 not part of the agreement.
Latest updates on Syria ceasefire
Osama Abu Zaid, a spokesman for the Free Syrian Army (FSA), a loose alliance of several moderate rebel factions under the HNC, said the deal also did not include the Kurdish Popular Protection Units (YPG).
The YPG, along with other Kurdish militias, controls a large area of northern Syria up the Turkish border. It is regarded by Turkey as a terrorist organisation and an extension of the banned Kurdistan Workers' Party (PKK).
However, the ceasefire will take in the rebel-held eastern Ghouta area near Damascus, which had been a sticking-point in negotiations.
The HNC, the umbrella group representing Syria's political and armed opposition factions, said that, because of the rebels' limited resources against government forces and their allies, it was "not possible to continue" the fight.
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.
UN envoy for Syria, Staffan de Mistura, welcomed the new deal, saying he hoped it would save lives, improve aid delivery and pave the way for productive peace talks.
Previous ceasefire initiatives this year brokered by the UN, or the US acting with Russia, quickly collapsed.
Astana to host talks
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".
Peace talks, to begin within a month of the ceasefire, would be held in the capital of Kazakhstan, Astana.
The Kurdish YPG would not take part in the peace talks, the FSA said.
Complications ahead - BBC's Selin Girit in Istanbul
A year ago, no-one would have expected Turkey-Russian relations to get to this level.
Ankara's moving closer to Moscow was bound to affect its policy on Syria. Now they have managed to broker a ceasefire.
However, there seems to be disagreement on which groups are left out.
Foreign Minister Mevlut Cavusoglu mentioned that foreign fighter groups, including Hezbollah, needed to leave Syria as well - which will not sit well with Iran, a major backer of the Bashar al-Assad regime.
Whether Ankara is prepared to give up on its long-term goal of ousting Mr Assad could complicate negotiations with Russia.
Turkey's foreign ministry also emphasised it was crucial for all states with influence over the groups in Syria to comply with and support the ceasefire - an obvious call to Washington, among others.
Key rebel groups, including the powerful Ahrar al-Sham and Army of Islam factions, have signed the ceasefire deal.
A spokesman for the FSA said it would abide by the truce but would retaliate against violations by government forces and their allies.

The FSA's Osama Abu Zaid said it had had no direct talks with the Syrian government ahead of the ceasefire deal and still insisted that President Bashar al-Assad would have no place in the future of Syria.
At least 300,000 people are believed to have been killed in fighting that followed the uprising against President Assad in March 2011.
A further four million have fled the country to seek refuge in neighbouring states or Europe.
http://www.bbc.co.uk/news/world-middle-east-38460127








