YEREVAN, Armenia — Serzh Sargsyan, who ruled Armenia for 10 years, resigned Monday as prime minister after thousands of people poured into the streets to protest his political maneuvering to cling to power in this former Soviet republic.

The stunning development touched off jubilation in the capital of Yerevan, with car horns blaring and people dancing, hugging and waving the tricolor Armenian flag. The opposition called for a meeting with the acting prime minister to discuss a “peaceful transfer of power.”

Sargsyan, 63, was president of the Caucasus mountains nation from 2008 until term limits forced him out in March. But parliament, which is controlled by his party, voted to reduce the powers of the presidency and give them to the prime minister, ultimately installing Sargsyan in that post last week.

The move echoed a maneuver a decade ago by Russian President Vladimir Putin, Armenia’s closest ally. Leaders of other former Soviet republics, from Belarus to Central Asia, have similarly extended their terms.

The parliament’s action had triggered massive anti-government protests in Yerevan since April 13, with demonstrators blocking government buildings and facing off with police. A rally on Sunday attracted about 50,000 people, and about 200 soldiers joined the protesters on Monday.

Protest leader Nikol Pashinian met Sunday with Sargsyan, who walked out of the session after Pashinian refused to talk about anything but the prime minister’s resignation. Pashinian was later arrested but abruptly released on Monday.

In his surprise resignation announcement posted on his website, Sargsyan said he should not have resisted the opposition’s demands.

“Nikol Pashinian was right. I was wrong,” Sargsyan said. “The movement on the streets is against my rule. I’m complying with their demands.”

The government quickly named former Prime Minister Karen Karapetian as acting prime minister. A Sargsyan ally, he also was mayor of Yerevan and worked in Russia for five years as a top executive of the state-controlled gas giant Gazprom.

Pashinian told an evening rally of tens of thousands of people at Republic Square in Yerevan that opposition activists want to meet with Karapetian on Wednesday to discuss a “peaceful transfer of power.”

The opposition will push for an early parliamentary election to prevent Sargsyan from running Armenia from behind the scenes, Pashinian said.

Alexander Iskanderian, director of the Caucasus Institute in Yerevan, said the protests pushed Sargsyan into a corner:

“The protests in the past couple of days have swelled to a point that you either had to use violence or find another way out,” Iskanderian told The Associated Press.

Russian officials and state television have been cautious in commenting on the political crisis in Armenia. In the past, Moscow has decried anti-government rallies and so-called “color revolutions” in neighboring post-Soviet nations as examples of hostile Western interference.

In what appeared to be the first official Russian reaction, Russian Foreign Ministry spokeswoman Maria Zakharova lauded Sargsyan’s decision as a move to unify the nation.

“The people who have the strength to keep respect toward each other despite crucial differences and stay united even in the most difficult moments of its history is a great people,” Zakharova wrote on her Facebook account. “Armenia, Russia is always with you!”

When Sargsyan switched to the prime minister’s job, his ally Armen Sarkisian, a former prime minister and ambassador to Britain, was elected president. Sarkisian was seen as an unofficial Sargsyan appointee.

Associated Press writer Nataliya Vasilyeva in Moscow and Angela Charlton in Paris contributed.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.