Armenian Prime Minister Nikol Pashinyan, a reformer challenged with a historic war, has beat back critics with a resounding election victory in snap polls he called to defuse protests against his rule.

His party won an outright majority in the parliamentary vote held Sunday, despite widespread frustration with his handling of a disastrous war last year with Armenia's historic rival Azerbaijan.

The former journalist, who had spent time in jail as an opposition activist, was celebrated as a national hero when he swept to power in a peaceful revolution in 2018.

But his decision last November to end the war with Azerbaijan and hand over territory to Armenian forces had controlled for decades ignited protests that left the 46-year-old fighting for his political survival.

He had come under immense pressure to resign for putting his signature on a ceasefire deal that ended six weeks of fighting for control of the Nagorno-Karabakh region inside Azerbaijan -- a fight that claimed some 6,000 lives, mostly Armenians.

"The people of Armenia gave our Civil Contract party a mandate to lead the country and personally to me to lead the country as prime minister," Pashinyan said in a speech broadcast on his Facebook page.

Nikol Pashinyan's signature of a ceasefire with Azerbaijan threatens to torpedo his political career
Nikol Pashinyan's signature of a ceasefire with Azerbaijan threatens to torpedo his political career press service of Armenia's gover / TIGRAN MEHRABYAN

On Monday morning, in the wake of his win, he visited a military cemetery, kneeling and laying flowers at the graves of soldiers.

The election was his answer to protracted calls from within the highest levels of Armenia's political leadership -- including the president and military leaders -- who had demanded his resignation over the country's humiliating defeat.

Ahead of the vote, analysts said he was still the most popular politician in the country and his backers said he deserved another chance.

The former newspaper editor and self-styled man of the people swept to power with a promise of change in 2018, spearheading a wave of peaceful protests against corrupt post-Soviet elites.

The Armenian prime minister is fighting for his political survival
The Armenian prime minister is fighting for his political survival Armenian Government / Tigran MEHRABYAN

Pashinyan at the time mingled with crowds on the streets of Yerevan, winning over supporters with animated revolutionary speeches.

In the provinces, villagers greeted him as a hero, offering him fresh bread and berries as he led the protest movement.

He walked hundreds of kilometres across the country, slept in the open, clambered onto the roofs of garages and stood on benches to deliver speeches.

Three years on, during the campaign, Pashinyan was met with insults like "Traitor! Capitulator!"

His rival, former president Robert Kocharyan, accused him of yielding "everything to the enemy".

But Pashinyan -- usually affable -- fought back, brandishing a hammer at rallies and promising it would fall on the head of opponents.

He was born in 1975 in the small resort town of Ijevan in northern Armenia and studied journalism at Yerevan State University, but was expelled in 1995 for what he said were articles he wrote that were critical of the regime.

He spent time in prison between 2009 and 2011 on charges of trying to seize power and provoking riots in post-election violence in 2008 and was then elected to parliament after his release.

He would ultimately unseat veteran leader Serzh Sargsyan after a decade in power.

As prime minister he launched a crusade against graft, initiated economic reforms and sidelined corrupt oligarchs and monopolies.

Supporters praised him for accelerating economic growth, reducing poverty and creating new jobs. But then the coronavirus pandemic struck, followed by the war with Azerbaijan.

As the fighting last autumn raged, the politician with a soft handshake and bashful grin morphed into a tough-talking commander-in-chief.

He described having to sign the ceasefire as "unspeakably painful" both personally and for the country.