Armenia’s embattled Prime Minister Nikol Pashinyan announced snap polls Thursday in a bid to defuse a political crisis that has shaken the country since last year’s military defeat to Azerbaijan.

Pashinyan has faced calls to resign since November when he signed a peace deal brokered by Russia that ended weeks of fighting for control of the mountainous Nagorno-Karabakh region in Azerbaijan.

Also Read | Thousands of Armenians march in memory of Karabakh victims

Armenia’s humiliating defeat at the hands of Azerbaijan’s technologically superior army spurred mass protests in the impoverished ex-Soviet republic on the borders of Turkey and Iran.

Last month Pashinyan fired the country’s most senior military official, accusing the army chief of staging a coup after he called on the prime minister to resign.

The spat sparked massive demonstrations, with Pashinyan’s supporters and his opponents flooding the streets of the capital.

In an effort to ease weeks of tensions that saw Pashinyan’s critics set up barricades and camp outside government buildings, the prime minister on Thursday announced an early election for later this year.

Also Read | Azerbaijan makes first gas deliveries to Europe

“Snap parliamentary elections will be held on June 20,” Pashinyan wrote on Facebook.

He said the decision was taken after talks with members of the opposition and President Armen Sarkisian, who has also called for Pashinyan to resign.

A fresh vote in June, Pashinyan said, is “the best way out of the current internal political situation”.

Prominent members of the opposition, who have been calling loudly for Pashinyan’s resignation and leading street demonstrations against his rule, welcomed his announcement.

“I said several days ago that we need a new government so that our homeland overcomes the current tough situation,” Gagik Tsarukyan, the leader of opposition Prosperous Armenia party, wrote on Facebook.

“Snap parliamentary polls are the only legitimate way to achieve this.”

Also Read | Saudi Arabia faces drone and missile attack on oil facilities

Edmon Marukyan, the leader of the opposition Bright Armenia party, said the decision to hold June elections was “acceptable to us”.

The opposition will hope to make gains to shift Pashinyan’s large majority in parliament. His My Step Alliance currently holds 83 seats against the opposition’s 49.

Pashinyan has dismissed repeated calls from the opposition to stand down and insisted he handled the war correctly.

Earlier Thursday, he defied a court ruling to reinstate the military commander who had called for him to resign, saying the order was unconstitutional.

Armenia’s military, equipped with ageing Soviet-era hardware, struggled to hold ground it had controlled for three decades when clashes broke out against Azerbaijan’s better-equipped army in Nagorno-Karabakh in September.

Also Read | 10 years on, no peace after war in Syria

After six weeks of fighting that claimed around 6,000 lives, the ceasefire agreement signed by Pashinyan forced Armenia to cede swathes of territory to Azerbaijan.

Azerbaijan had already regained control of several districts around Nagorno-Karabakh that the region’s separatist forces had seized in the 1990s war, including the strategically and symbolically important town of Shusha.

Pashinyan at the time said he had no choice but to agree or see his country’s forces suffer even bigger losses.

The 45-year-old former newspaper editor came to power spearheading peaceful protests in 2018 and initially brought a wave of optimism to Armenia.