MOSCOW — Russian peacekeeping forces were deployed to the disputed ethnic Armenian enclave of Nagorno-Karabakh on Tuesday after Armenia and Azerbaijan signed a Russian-brokered deal to end a six-week war that had already killed thousands.
Some Armenians were furious that Nikol Pashinyan, the country’s prime minister, signed the accord, which cedes to Azerbaijan a broad swath of land and several key towns that had been effectively controlled by Armenia since 1994.
Opposition politicians called for Mr. Pashinyan’s resignation, while protesters broke into the Parliament and beat its speaker, Ararat Mirzoyan, who required surgery. Protesters also stormed the prime minister’s office, where, Mr. Pashinyan said later, a computer and a wristwatch were stolen.
Amid the tumult Tuesday morning, Mr. Pashinyan posted on Facebook that he was in Armenia and continued to work as prime minister. The country’s leadership struggled to convince the public that it had no choice but to stop the fighting now, because Armenia had suffered steep losses of life and territory.
“We have once again proved that we have invincible soldiers, officers and generals who are ready to sacrifice their lives for the defense of our holy motherland without a second thought,” Armenia’s Defense Ministry said in a statement. “But it is time to stop the bloodshed.”
Richard Giragosian, the director of the Regional Studies Center in Yerevan, said he was woken at 3 a.m. by yelling and the honking of car horns. But there was also a gathering sense of resignation among Armenians, he said.
“There’s a general sense in the streets that we had no choice, that this was the best alternative to save what was left of Nagorno-Karabakh,” Mr. Giragosian said.
There was also pain: the lush mountains of Nagorno-Karabakh, known to Armenians as Artsakh, had long been part of a national and ethnic identity for Armenians around the world. The loss of that territory on Tuesday was already taking a place in the annals of tragedy in Armenian history, alongside the slaughter and expulsion of Armenians from Turkey a century ago in what most neutral historians call the century’s first genocide.
“The trauma of victimization has returned,” Mr. Giragosian said. “There’s a sense that the world and the West have abandoned us.”
“We lost the war, and this is the tragic reality which we should accept,” Tatul Hakobyan, an Armenian journalist who has covered the region for more than 30 years, said in a telephone interview.
Mr. Hakobyan said small-arms fire was audible from the capital of Nagorno-Karabakh, Stepanakert, on Sunday, indicating that Azerbaijani forces were closing in. Azerbaijan captured the hilltop town of Shusha in recent days, which is six miles from Stepanakert and a historic and cherished place for both Azerbaijanis and Armenians.
Three cease-fires negotiated by the two sides since the start of the war have collapsed. But the latest agreement is different because it involves Armenia’s accepting Azerbaijan’s territorial gains and will be enforced by Russian peacekeepers, who will be present for at least five years.
“We proceed from the assumption that the agreements reached will create the necessary conditions for a lasting and full-scale settlement of the crisis over Nagorno-Karabakh on a fair basis and in the interests of the people of Armenia and Azerbaijan,” President Vladimir V. Putin of Russia, who brokered the agreement between Mr. Pashinyan and President Ilham Aliyev of Azerbaijan, said in a statement overnight.
Under the agreement, some 1,960 armed Russian service members and 90 armored personnel carriers will deploy to guard the line of contact between Armenian and Azerbaijani forces in the region and along the road connecting Armenian-controlled Nagorno-Karabakh to Armenia. On Tuesday, the Kremlin-controlled RT television network broadcast footage of Russian military vehicles departing the Armenian border city of Goris for Nagorno-Karabakh.
Armenia’s Defense Ministry said Tuesday morning that combat operations along the front line had been suspended and that Russian peacekeepers were being deployed. In Azerbaijan, Mr. Aliyev described the agreement as one of his country’s greatest triumphs.
“We are proud of our people, of our Armed Forces!” Mr. Aliyev said in a Twitter posting on Tuesday. “For our people, these days are the happiest ones.”
The end of the war suggests a sweeping redrawing of the security map of the southern Caucasus, a volatile region wedged between Turkey, Russia and Iran. The settlement sealed a role in the region for an increasingly assertive Turkey, which had backed Azerbaijan in the war that began in September.
Mr. Putin has spoken with President Recep Tayyip Erdogan of Turkey at least three times since the start of the war, most recently on Saturday. Mevlut Cavusoglu, Turkey’s foreign minister, hailed the agreement as “a great success and victory for Azerbaijan.”
But Russia’s leading role in stopping the fighting also shows that Moscow continues to be the most influential player in the southern Caucasus, which was part of the Soviet Union. Some Armenians had hoped for a more forceful Russian role in the war, since the two countries have a mutual-defense treaty.
But according to Mr. Hakobyan, the Armenian journalist, it was Russia’s decision to send peacekeepers that spared Armenians from more of Nagorno-Karabakh — including Stepanakert — falling under Azerbaijani control.
“Smart and sober Armenians understand that the Russians intervened and in a way saved Karabakh proper,” Mr. Hakobyan said.