A Russian-brokered deal to halt fierce fighting over the disputed region of Nagorno-Karabakh has sparked jubilation in Azerbaijan and furious protests in neighbouring Armenia.
Russia started deploying almost 2,000 peacekeepers and armoured vehicles to the region on Tuesday, as Azerbaijan hailed an agreement that cements its recent gains on the battlefield and obliges Armenian forces to leave areas in and around Nagorno-Karabakh that they have held since a war in the early 1990s.
Azerbaijani president Ilham Aliyev said many Azeris displaced during that conflict could now finally return home, and he exchanged messages of congratulation with top officials from his country's chief ally Turkey.
In Armenia, by stark contrast, protesters stormed parliament and beat up its speaker amid widespread anger over a deal that the country's prime minister, Nikol Pashinyan, described as "unspeakably painful for me and for our people".
The agreement marks a new phase in the dispute over Nagorno-Karabakh, a mountainous region of Azerbaijan that has been run by its ethnic Armenian majority – with full backing from Armenia – for almost 30 years.
“This is a victory for all of us, for all the people of Azerbaijan. The people of Azerbaijan have once again shown what a great nation, what a patriotic nation, what a people with an iron will we are,” Mr Aliyev declared on Azeri television.
“We said that we would show the enemy its place, drive the enemy out of our lands, and we drove them away... I am sure that all citizens of Azerbaijan believe that these days and minutes are the happiest in their lives.”
As crowds of Azeris sang and waved flags in Baku and other cities, angry Armenians rallied in their capital, Yerevan, to denounce the deal.
“I made this decision based on thorough analysis of the military situation and assessment of the situation by experts,” Mr Pashinyan said of the agreement.
“This is not a victory, but there is no defeat as long as you do not recognise yourself as defeated... Long live Armenia. Long live Artsakh,” he added, using the Armenian name for Nagorno-Karabakh.
Demonstrators smashed windows of government buildings and forced their way into parliament, while on a nearby street a mob dragged the chamber's speaker, Ararat Mirzoyan, from his car and beat him unconscious.
However, while the crowd accused the government of betrayal, Nagorno-Karabakh's ethnic Armenian leader, Arayik Harutyunyan, said that if "hostilities [had] continued at the same pace we would have lost all of Artsakh within days".
Armed with high-tech drones from Turkey, energy-rich Azerbaijan’s military retook swathes of territory in and around Nagorno-Karabakh during six weeks of fighting that claimed well over 1,000 lives.
The peace deal lays out a timetable for Armenian forces’ withdrawal from other parts of the region but does not make clear the future status of its capital, Stepanakert, and the surrounding area.
Russian peacekeepers, with a five-year mandate, will oversee implementation of the peace deal and protect the main road between Nagorno-Karabakh and Armenia; the agreement also provides for a new road corridor to link Azerbaijan and Turkey via Armenian territory.