Russia deployed peacekeeping troops to the war-ravaged enclave of Nagorno-Karabakh in the early hours of Tuesday as part of a ceasefire deal President Vladimir Putin said should pave the way for a lasting political settlement of the conflict there. The deal, agreed by Armenia, Azerbaijan and Russia, ushered in a full ceasefire from midnight Moscow time on November 10, halting a conflict that has killed thousands, displaced many more and threatened to plunge the wider region into war. The territory is internationally recognised as part of Azerbaijan but is populated and, until recently, fully controlled by ethnic Armenians who have been relentlessly pushed back by the armed forces of Azerbaijan in six weeks of heavy fighting. Under the deal, Azerbaijan will keep all of its territorial gains, including the enclave's second city of Shusha, and ethnic Armenian forces will hand over control of a slew of other territories between now and December 1. Russian peacekeepers will stay in place for at least five years. Mr Putin said they would be deployed along the front line in Nagorno-Karabakh and in a corridor between the region and Armenia. The Russian defence ministry said it had started deploying 1,960 servicemen, who were en route to an unnamed airbase to be airlifted along with their equipment and vehicles. The deal is likely to be seen as a sign that Russia is still the main arbiter in a region it regards as its own backyard, though the scale of Turkish involvement remained unclear and Ankara's interest in the region has sharply increased. Turkey staunchly supported Azerbaijan, while Russia has a defence pact with Armenia and a military base there. Mr Putin said displaced people would now be able to return to Nagorno-Karabakh, and prisoners of war and the war dead could be exchanged, while 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," Mr Putin said. Ilham Aliyev, the president of Azerbaijan, said Turkey would also be involved in peacekeeping efforts. There was no immediate response from Ankara. In Armenia, Prime Minister Nikol Pashinyan tried to put a brave face and said the decision was taken after "a deep analysis of the combat situation and in conjunction with the best experts". "This is not a victory, but there is no defeat until you consider yourself defeated," he said on social media. "We will never consider ourselves defeated and this shall become a new start of an era of our national unity and rebirth." Unrest broke out in Yerevan, the Armenian capital, however, as several hundred protesters gathered in front of government buildings to protest against the deal and demanded to see Mr Pashinyan. They shouted "We will not give it up," referring to Nagorno-Karabakh. Video posted on social media showed dozens of people breaking into a government building and smashing up furniture inside. Mr Pashinyan said anyone involved in the unrest would be severely punished. The deal followed three failed ceasefires and relentless advances by Azerbaijan's forces. Baku said earlier 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 the city called Shusha by Azeris but known by Armenians as 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. Some Armenian politicians had disputed on Monday that the city had fallen, although ethnic Armenian forces said it was no longer under their control. Since fighting erupted on September 27, Azerbaijan said it had 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. Armenia has repeatedly denied the scale of Azerbaijan's territorial gains.