Prime Minister Nikol Pashinyan's agreement overnight Monday to end fighting with Azerbaijan over the disputed Nagorno-Karabakh region sparked widespread anger from Armenians that threatens to spiral into a full-blown political crisis.

Hundreds of demonstrators demanding Pashinyan's resignation stormed government buildings in Yerevan after he announced the Russian-brokered ceasefire, which came after a series of stinging battlefield defeats at the hands of a long-standing enemy.

Armenia's loss of swathes of territory in Nagorno-Karabakh and its agreement to end hostilities was described by Azerbaijani leader Ilhman Aliyev as a "capitulation".

The defeat after more than six weeks of fighting that left over 1,400 people dead including dozens of civilians has spurred a national crisis in Armenia and gathered storm clouds around Pashinyan.

The leaders of two opposition parties, Gagik Tsarukyan and Edmon Marukyan, called on the prime minister to explain the decision to end fighting to parliament.

On Monday, before the agreement with Azerbaijan was even signed, 17 parties called for Pashinyan to step down -- including that of former leader Serzh Sarkisian who was ousted from power in protests led by Pashinyan in 2018.

Armenian police detain a protestor near the government building after a protest against the country's agreement to end fighting with Azerbaijan
Armenian police detain a protestor near the government building after a protest against the country's agreement to end fighting with Azerbaijan AFP / Karen MINASYAN

That call was echoed by the "hero" of Armenia's first war with Azerbaijan in the 1990s, Vitaly Balasanyan, who called on "all political forces in Armenia" and Karabakh "to push the prime minister to resign".

Karabakh, a mountainous and ethnic-Armenian province in Azerbaijan, plays a central role in Armenia's political life.

Two former presidents, including the influential Robert Kocharyan who was in power from 1998 to 2008, come from the territory that claimed independence from Baku nearly 30 years ago.

A foreign observer to the conflict said on condition of anonymity that he feared soldiers who had fought on the frontlines would return to Yerevan and demand to "settle scores".

Angry protesters gather at Armenian govt headquarters
Angry protesters gather at Armenian govt headquarters AFPTV / Karen MINASYAN

President Armen Sarkisian, whose role is largely ceremonial, said Tuesday he was initiating "political consultations to find a solution to protecting national interests as soon as possible" and form a national unity government "urgently."

Yet Pashinyan still has the backing of several key political players and explained that he only signed the truce agreement with the blessing both of the army and separatist leaders in Karabakh.

He believes he has helped the separatist region survive, even if it is diminished.

Chief of staff Onik Gasparyan met with opposition officials overnight and urged calm, while the defence ministry called on Armenians to "refrain from any actions that could undermine the foundations of the state".

"We do not need a civil war. We must remain united," the leader of Karabakh Arayik Harutyunyan said.

The announcement by Harutyunyan's spokesman on Monday that Azerbaijan had captured the key town of Shusha in Karabakh was a clear catalyst, even as Pashinyan insisted the fight for the strategic city was continuing.

The contradicting statements brought on several hours of uncertainty ultimately ending in the announcement of the Russian-brokered agreement.

Pashinyan, who swept to power with a promise of change, spearheading a wave of peaceful protests in 2018, described the accord as "unspeakably painful for me and for our people".

He issued three separate live appeals on Facebook for the population to accept the decision over Karabakh, a historical and cultural cradle for Armenians.

"We fought against terrorists, against Azerbaijan and a NATO member, Turkey," he said, referring to accusations that Ankara dispatched mercenaries from Syria to fight alongside Baku's army.

"Our army fought with honour," he said.

He added that no one would escape taking responsibility for their actions, vowing that in the meantime, "I am in Armenia and I continue to serve as prime minister".