Some 2,000 Russian peacekeepers are set to arrive in Nagorno-Karabakh to oversee a new cease-fire aimed at halting the heaviest fighting in decades between Azerbaijan and ethnic Armenians for control of the breakaway region.
The announcement of the new Kremlin-backed deal sparked unrest in Armenia, where protesters poured into the streets and stormed the main government building to oppose an agreement they see as one-sided after thousands were killed in the fighting. By contrast, there were celebrations in parts of Azerbaijan.
Russian President Vladimir Putin called the situation in Nagorno-Karabakh "a truly great tragedy" and said he hoped that the agreement would create "a long-term peace" and "set up necessary conditions for long-lasting and full-scale settlement of the crisis over Nagorno-Karabakh."
That crisis erupted again in late September, when Azerbaijan launched a military push to retake parts of Nagorno-Karabakh, an ethnic Armenian enclave that is located within the borders of Azerbaijan.
The disputed region broke away following the collapse of the Soviet Union, after a conflict that claimed some 30,000 lives. In the years that followed, there had been sporadic clashes, but nothing to rival the fighting in recent weeks.
The Russian-brokered deal is the latest in a series of attempts to end the fighting. Last month, a deal overseen by the U.S. was one of several that quickly collapsed.
Moscow's truce leaves Azerbaijan with significant territorial gains.
In the past few days, Azerbaijani forces have seized the region's second-largest town — known as Shusha to Azerbaijanis and Shushi to Armenians — the most significant conquest of the recent fighting and one that gives Azerbaijan the upper hand in negotiations.
The city overlooks the regional capital of Stepanakert and lies along the main road connecting it with Armenia. The Associated Press reports that long lines of vehicles jammed the road over the weekend as residents from Nagorno-Karabakh fled to Armenia.
Under the cease-fire, Azerbaijan will keep territory it gained in recent fighting. Armenia will return control of three districts in Nagorno-Karabakh to Azerbaijan over the next few weeks.
Among the regions Armenia is to hand over is Lachin, with its main road linking Nagorno-Karabakh to Armenia. The so-called Lachin Corridor is to be kept open by some of the 1,960 Russian peacekeepers deployed with a five-year mandate to oversee the agreement. The deal also calls for transport links to be established between Azerbaijan and Nakhchivan, a landlocked semi-autonomous Azerbaijani exclave surrounded by Armenia, Iran and Turkey.
The cease-fire also provides for an exchange of soldiers captured in the fighting and bodies of the dead.
Armenian Prime Minister Nikol Pashinyan acknowledged in a message on Facebook that agreeing to end the fight was "extremely painful for me personally and for our people."
His announcement was received with anger by many Armenians, thousands of whom poured into the main square in the capital, Yerevan, to protest, many shouting "We won't give up our land!" Others stormed and ransacked the main government building, including the office of Pashinyan, who was not present.
In Ganja, one of the largest cities in Azerbaijan, people waved Azerbaijani flag to celebrate the apparent end of the military conflict over Nagorno-Karabakh.
Azerbaijan's forces on Monday shot down a Russian helicopter near Armenia's border with Nakhchivan, killing two servicemen in what Azerbaijan's foreign ministry chalked up to "the tense situation in the region and increased combat readiness in connection with possible provocations of the Armenian side," according to the AP.
A spokesman for the Collective Security Treaty Organization (CSTO), of which Russia and Armenia are members, expressed regret that the conflict in Nagorno-Karabakh "led to sad consequences."
NPR's Lucian Kim in Moscow contributed to this report.