Armenia and Azerbaijan have agreed to a ceasefire in Nagorno-Karabakh after two weeks of heavy fighting that marked the worst outbreak of hostilities in the region in 25 years.
Diplomats from the two countries said in a statement the truce is intended to exchange prisoners and recover the dead.
They added that specific details will be agreed on later.
The ceasefire will begin at 12pm on Saturday and follows 10 hours of talks between diplomats in Moscow, which were sponsored by Russian Foreign Minister Sergei Lavrov.
Mr Lavrov said the ceasefire should pave the way for talks on settling the conflict.
The latest outburst of fighting between Azerbaijani and Armenian forces began on 27 September and left hundreds of people dead in the biggest escalation of the decades-old conflict over Nagorno-Karabakh.
The region lies in Azerbaijan but has been under control of ethnic Armenian forces backed by Armenia since the end of a separatist war in 1994.
The talks between the foreign ministers of Armenia and Azerbaijan were held on invitation from Russian President Vladimir Putin, who brokered the cease-fire in a series of calls with President Ilham Aliyev of Azerbaijan and Armenia’s Prime Minister Nikol Pashinian.
If the truce holds, it would mark a major diplomatic coup for Russia that has a security pact with Armenia but also cultivated warm ties with Azerbaijan.
Speaking in an address to the nation Friday hours before the cease-fire deal was reached, the Azerbaijani president insisted on his country’s right to reclaim its territory by force after nearly three decades of international talks that “haven’t yielded an inch of progress”.
Mr Aliyev said: “Mediators and leaders of some international organisations have stated that there is no military solution to the conflict.
“I have disagreed with the thesis, and I have been right. The conflict is now being settled by military means and political means will come next.”
The current escalation marked the first time that Azerbaijan’s ally Turkey took a high profile in the conflict, offering strong political support.
Over the past few years, Turkey provided Azerbaijan with state-of-the-art weapons, including drones and rocket systems that helped the Azerbaijani military outgun the Nagorno-Karabakh separatist forces in the latest fighting.
Armenian officials say Turkey is involved in the conflict and is sending Syrian mercenaries to fight on Azerbaijan’s side.
Turkey has denied deploying combatants to the region, but a Syrian war monitor and three Syria-based opposition activists have said that Turkey has sent hundreds of Syrian opposition fighters to fight in Nagorno-Karabakh.