Armenia‘s prime minister has resigned unexpectedly after his acceptance of the post brought thousands of people on to the streets for days of protests.

Serzh Sargysyan was accused of clinging to power after parliament installed him as premier earlier this month in the wake of a 10-year stint as president.

Pressure on the 63-year-old to quit had increased sharply on Monday, when unarmed soldiers in the capital, Yerevan, joined the anti-government protests.

“I got it wrong,” he said in a statement issued by his office.

“In the current situation there are several solutions, but I won’t choose any of them. It’s not my style. I am quitting the country’s leadership and the post of prime minister of Armenia.”

In Yerevan, residents poured out onto the streets to celebrate.

They hugged and kissed each other, while motorists honked their horns.

Armenia’s former prime minister, Karen Karapetyan, an ally of Mr Sargsyan, was named as acting prime minister, Russia’s RIA news agency said, citing the Armenian government’s press office.

Armenia’s political parties in parliament now have seven days to put forward the name of a new prime minister.

Mr Sargsyan's appointment as prime minister came during a transition to a new governmental system which reduces the powers of the presidency and enhances those of the premier.

Thousands of anti-government protesters have been rallying in the streets of the capital since 13 April. A protest on Sunday attracted some 50,000 demonstrators.

Armenia's prime minister, Serzh Sargsyan, stands before leaving a televised meeting with anti-government protest leader Nikol Pashinyan (VANO SHLAMOV/AFP/Getty Images)

The leader of the protest, Nikol Pashinyan, was arrested on Sunday after he met the former prime minister for talks.

Before Mr Sargsyan stormed out of the meeting, Mr Pashinyan had said: “I am telling you: you have no understanding of the situation in the country. The situation is different to the one you knew 15-20 days ago.

“The situation in Armenia has changed, you don’t have the power of which you are told. In Armenia, the power has passed to the people.

In his statement announcing his resignation, Mr Sargsyan said: ”Nikol Pashinian was right. I was wrong.”