Russian peacekeeping troops deployed to the mountain enclave of Nagorno-Karabakh on Tuesday as part of a ceasefire deal designed to end six weeks of heavy fighting between Azerbaijan and ethnic Armenian forces.
Under the deal, Azerbaijan will keep territorial gains made in the fighting, including the enclave's second city of Shusha, which Armenians call Shushi. Ethnic Armenian forces must give up control of a slew of other territories between now and December 1.
Russian President Vladimir Putin said the arrangement should pave the way for a lasting political settlement of a conflict which has killed thousands, displaced many more, and threatened to plunge the wider region into war.
The ceasefire triggered celebrations in Baku, the capital of Azerbaijan, where cars and buses sounded their horns in delight and people cheered and waved the Azeri national flag.
But unrest broke out in Yerevan, the capital of Armenia, where crowds stormed and ransacked government buildings overnight, labelling the deal a betrayal. Some demanded the resignation of Prime Minister Nikol Pashinyan.
Pashinyan said on Tuesday he had concluded the peace deal under pressure from his own army, which said all military action in Nagorno-Karabakh had stopped and that the situation was calm.
Nagorno-Karabakh is internationally recognised as part of Azerbaijan but populated and, until recently, fully controlled by ethnic Armenians who have been pushed back by Azerbaijan's armed forces in recent weeks.
Since fighting erupted on Sept. 27, Azerbaijan says it has retaken much of the land in and around Nagorno-Karabakh that it lost in a 1991-94 war in which an estimated 30,000 people were killed.
The deal is likely to be seen as a sign that Russia, which has a defence pact with Armenia and a military base there, is still the main arbiter in a region it regards as its own backyard, despite Turkish attempts to muscle in.
Russian peacekeepers will stay in place for at least five years, expanding Moscow's military footprint in the region. Putin said they would be deployed along the frontline in Nagorno-Karabakh and in a corridor between the region and Armenia.
Putin Envisages Lasting Settlement
The last of 10 military planes carrying Russian peacekeepers took off on Tuesday, the Russian defence ministry said. Almost 2,000 servicemen, 90 armoured personnel carriers, and 380 vehicles and pieces of other hardware are being deployed.
Russian state TV broadcast footage of a Russian military column moving from southern Armenia towards Nagorno-Karabakh.
Under the agreement, Azerbaijan will also gain a road link to an Azeri exclave on the Iranian-Turkish border, something that will also give Turkey a land bridge to the rump Azerbaijan.
The Turkish military will help staff a joint monitoring centre with Russian forces. A deal setting up the centre was expected to be signed between Moscow and Ankara later on Tuesday.
Putin said displaced people would now be able to return to Nagorno-Karabakh, and prisoners of war and bodies of those killed would be exchanged. All economic and transport links in the area would be reopened with the help of Russian border guards.
"We are operating on the premise that the agreements will create the necessary conditions for a long-term and fully-fledged settlement of the crisis around Nagorno-Karabakh on a fair basis and in the interests of the Armenian and Azeri peoples," Putin said.
Unrest In Armenia
Ilham Aliyev, the president of Azerbaijan, said the deal was the culmination of what he called his country's glorious victory.
"This statement has historic significance. This statement constitutes Armenia's capitulation. This statement puts an end to the years-long occupation," he said.
In Armenia, Pashinyan tried to put a brave face on the situation.
"The decision was made based on a deep analysis of the combat situation and in conjunction with the best experts," he said of the deal on social media.
"This is not a victory, but there is no defeat until you consider yourself defeated. We will never consider ourselves defeated and this shall become a new start of an era of our national unity and rebirth."
But hundreds of protesters ransacked government buildings overnight in Yerevan, ran wild in parliament, and beat up the parliamentary speaker who was taken to hospital.
Protesters, referring to Nagorno-Karabakh, shouted: "We will not give it up.".
Arayik Harutyunyan, the leader of ethnic Armenians in Nagorno-Karabakh, said on Tuesday there had been no option but to conclude a peace deal.
"If the military action had continued with the same intensity, we would have lost all of Nagorno-Karabakh in several days and would have many more casualties," he said.
Seventeen small political parties demanded Pashinyan resign and a petition was started demanding the agreement be annulled.
The deal followed three failed ceasefires and relentless advances by Azerbaijan's forces.
Baku said on Monday it had seized dozens more settlements in Nagorno-Karabakh, a day after proclaiming victory in the battle for the enclave's strategically positioned second-largest city.
The capture of Shusha, or Shushi, appears to have been a turning point. It sits on a mountaintop overlooking Stepanakert, the city regarded as the enclave's capital by its ethnic Armenian administration.
An Azeri defence ministry video posted online showed Azerbaijan's national flag flying over deserted streets in what it said was Shusha.