The recent fighting has been the worst in decades, with at least 1,000 people killed including dozens of civilians, with the death toll believed to be much higher.
Under the deal, Russian peacekeepers will be deployed along the front line in Nagorno-Karabakh and the corridor between the region and Armenia.
Shusha, which Armenians call Shushi, is of strategic importance because it is 15 kilometers away from the enclave's largest city Stepanakert, and it also has particular cultural significance.
Russian Federation and Turkey have been supporters of Azerbaijan in the conflict.
Azerbaijan Foreign Ministry on Monday evening announced that it has accidentally shot down Russian military Mi-24 helicopter over Armenia border, killing two crew members. The ministry noted that the helicopter was flying in the dark at low altitude and "in the context of these factors and in light of the tense situation in the region and increased combat readiness in connection with possible provocations of the Armenian side, the duty combat crew chose to open fire to kill".
"Unfortunately, we are forced to admit that a series of failures still haunt us, and the city of Shushi is completely out of our control", Vagram Pogosian, a spokesman for the president of the government in Nagorno-Karabakh, said in a statement on Facebook.
"I have signed a statement with the presidents of Russian Federation and Azerbaijan on the termination of the Karabakh war", Pashinyan said, calling the move "unspeakably painful for me personally and for our people".
Russian peacekeeping troops have been deployed to the war-ravaged enclave of Nagorno-Karabakh as part of a ceasefire deal.
Tropical Storm Eta Hits Florida Keys
The 65 miles per hour (100 kph) winds were heading northwest towards the Florida mainland at around 14 miles per hour (22kph). Cars were stranded and entire neighborhoods were swamped as flash floods rose in areas where the water had no place to drain.
The deal followed three failed ceasefires and relentless advances by Azerbaijan's forces.
A third person was injured and evacuated, the ministry said in a statement, and a probe at the Russian base is under way. It was not clear who shot it down.
Azerbaijan has apologized to Russian Federation over what it described as a "tragic accident" and added that it was prepared to pay compensation.
The helicopter was downed near the border with Nakhcivan, an exclave of Azerbaijan surrounded by Armenia, Turkey and Iran.
Nagorno-Karabakh's independence declaration led to the 1988-1994 war and to Azerbaijan's loss of the region along with seven adjacent areas.
Under the deal, Azerbaijan will get to keep all of its territorial gains, including the enclave's second city of Shusha/Shushi, and ethnic Armenian forces must hand over control of a slew of other territories between now and December 1. They ransacked Pashinyan's office and broke windows and furniture in government buildings.
Turkey is a key ally of Azerbaijan and its involvement would be key to any agreement to halt the fighting. Pashinyan said anyone involved in the unrest would be severely punished.
"The authorities have lost their moral and political basis to represent the people", they said.