People march during a protest against the appointment of ex-president Serzh Sarksyan as the new prime minister in Yerevan, Armenia April 23, 2018. REUTERS/Vahram Baghdasaryan/Photolure

YEREVAN (Reuters) - A large group of unarmed Armenian soldiers joined anti-government protests in the capital Yerevan on Monday in a development the Armenian military said was illegal and would be harshly punished.

The move, likely to deepen the country’s biggest political crisis in a decade, follows days of street protests against Serzh Sarksyan, the newly-appointed prime minister whom protesters accuse of clinging to power.

Before being appointed prime minister, Sarksyan, 63, did a 10-year stint as president. Under a constitutional change, most state powers are now invested in his new role.

The protests, though peaceful so far, threaten to destabilize a key Russian ally in a volatile region riven by a long low level conflict between Armenia and Azerbaijan and would, if successful, be a rare example of people power delivering reform in the former Soviet Union.

Tens of thousands of protesters have marched through the capital Yerevan in recent days, blocking streets and staging sit-ins. They are demanding that Sarksyan resign to pave the way for early elections, something he has so far refused to do.

On Sunday, police detained three opposition leaders and nearly 200 protesters, drawing a rebuke from the European Union.

On Monday, men wearing military uniforms could be seen marching in Yerevan with protesters. Images broadcast on the Internet and social media showed the soldiers hugging protesters and waving the country’s national flag.

The Armenian Defense Ministry condemned what it said was their illegal action, saying the men belonged to a brigade of military peacekeepers.

“The harshest legal measures will be taken against the soldiers,” it said in a statement.