MOSCOW — Nearly 2,000 Russian peacekeeping troops were deployed to the disputed region of Nagorno-Karabakh on Tuesday after a cease-fire deal reached overnight allowed Azerbaijan to hold on to the substantial territory it has regained in six weeks of heavy fighting.

Russian President Vladimir Putin said the trilateral agreement among Azerbaijan, Armenia and Russia should halt fighting in the long term. Russia’s Foreign Ministry said Turkey, which has sided with Azerbaijan, backs the cease-fire deal.

A cease-fire deal reached Nov. 10, allowed Azerbaijan to hold onto the substantial territory it has regained from Armenia over six weeks of heavy fighting. (The Washington Post)

Previous efforts to end the latest fighting have unraveled. But the addition of Russian peacekeepers introduces a major deterrent in the more than three-decade-old conflict over Nagorno-Karabakh, an enclave controlled by ethnic Armenians but inside the internationally recognized borders of Azerbaijan.

“What is happening in Karabakh is a truly great tragedy,” Putin said. “I hope that all the steps we have taken recently will lead to the establishment of long-term peace for the benefit of the peoples of Azerbaijan and Armenia.”

The first Russian troops, traveling on Ilyushin-76 military planes, arrived in Armenia on Tuesday, according to the Russian Defense Ministry.

The final days of the conflict for Armenia and Nagorno-Karabakh fighters were devastating, according to Nagorno-Karabakh leader Arayik Harutyunyan.

He described Azerbaijan-directed drone attacks on Armenian soldiers, already hit hard by the coronavirus and dysentery and exhausted by weeks of fighting.

“The moral and psychological condition of the army was extremely poor,” he said. “We suffered very heavy human losses yesterday during the last few hours in the Martuni district, due to the drone attacks of the adversary.”

Armenian Prime Minister Nikol Pashinyan called the situation “a great failure for us, a great catastrophe, a great mourning for the lost lives,” adding that he took responsibility, according to a translation by the Russian Interfax news agency.

He said: “We did not fall into the abyss. We made the decision to stop in time. Otherwise our condition would be much worse. . . . Lessons must be learned.”

Under the deal, Armenian forces will withdraw from Nagorno-Karabakh, and Russian peacekeepers will take control of a three-mile-wide strip known as the Lachin region. Two other ­areas, Aghdam and Kalbajar, will be given back to Azerbaijan in the coming weeks, allowing the return of Azerbaijani refugees who fled in the early 1990s.

Russian peacekeepers will be deployed along the line of contact between Azerbaijan and Nagorno-Karabakh and in the Lachin region for five years, with possible five-year extensions.

A joint Russia-Turkey cease-fire monitoring center will be set up in Azerbaijan, according to Russian officials.

The cease-fire deal triggered outrage overnight in the Armenian capital, Yerevan, where angry protesters broke into government buildings after Pashinyan announced the agreement. They ransacked Pashinyan’s office and broke windows and furniture in government buildings. Parliament speaker Ararat Mirzoyan was attacked by a mob.

Vahagn Vardumyan, 43, who runs hiking tours in Yerevan, predicted that the deal would not bring peace. “We are trapped in an unfair game,” he said. “There is no sense of relief. The fighting is not going to stop, so how can there be relief?”

“For Armenians, Russia’s actions can be summed up in one word: betrayal,” he added. “To end the conflict this way is just insane. It is simply the worst possible thing that could have happened.”

The cease-fire came two days after Azerbaijan claimed it had won control of the ancient city of Shusha, known in Armenia as Shushi, an important symbolic goal for Azerbaijan. The Azerbaijani Defense Ministry posted a video Monday of the deserted-looking city with soldiers saluting Azerbaijani flags that were flying over government buildings.

Thousands have died in brutal fighting that saw both sides use cluster bombs, according to human rights observers. Armenian and Nagorno-Karabakh casualties reached at least 1,302, according to officials Tuesday, while Azerbaijan has not released the numbers of its losses. Putin said recently that at least 5,000 people had died.

Celebrations erupted in the Azerbaijani capital, Baku, on news of the cease-fire.

Turkey’s support for Azerbaijan dramatically shifted the strategic regional balance and paved the way for Azerbaijan’s swift gains.

In the fighting, drones that Azerbaijan had bought from Turkey and Israel proved decisive, destroying hundreds of Armenian tanks, wiping out air defense systems and killing dug-in soldiers in Nagorno-Karabakh.

Azerbaijan, enriched in recent decades by Caspian Sea oil, invested much of its wealth in buying military equipment in a bid to overturn its humiliating loss in the 1988-1994 war over Nagorno-Karabakh, which has a large Armenian population.

A declaration of autonomy by Nagorno-Karabakh led to the war and to Azerbaijan’s effective loss of the region along with seven adjacent areas.

Nearly three decades of talks failed to resolve the dispute, although Nagorno-Karabakh’s autonomy is not recognized internationally. France and the United States, co-chairs with Russia of the Minsk Group of the Organization for Security and Cooperation in Europe — which has mediated efforts to resolve the conflict — played no part in this week’s agreement, Russia’s Foreign Ministry said.

That agreement sees Russia retain a foothold in the region, with Turkey increasing its influence in an area that is important because of oil pipelines through the region.

Alexander Gabuev, analyst with the Carnegie Moscow Center, said Russia was left with “few good options” as war resumed in the region this summer.

He added that Moscow realized it could no longer completely dominate post-Soviet space, as Turkey asserted itself more.

“Moscow is satisfied with this outcome given the options that it has,” Gabuev wrote in a Twitter thread. “And I haven’t met any senior Russian official who believes that Moscow will ever be able to be in full control in the South Caucasus with no other powers in the mix. It’s more about balance than dominance.

 Putin spoke to Turkish President Recep Tayyip Erdogan on Tuesday.

Harutyunyan, Nagorno-Karabakh’s leader, listed a string of territorial losses since fighting broke out Sept. 27. He said Azerbaijan’s forces had come within a couple of miles of the Nagorno-Karabakh capital, Stepanakert.

“If the fighting continued at that pace, we would have lost Artsakh within days and would have had many more victims,” he said, using an Armenian term for Nagorno-Karabakh.

Armenia’s Defense Ministry released a statement Tuesday saying the military had “done everything possible and impossible” in the war.

Putin said refugees and internally displaced people would be able to return to their homes. Azerbaijani President Ilham Aliyev said transport links in the region would reopen.

Josh Losh in Yerevan contributed to this report.