Armenia's ruling party on Tuesday blocked a bid by opposition leader Nikol Pashinyan to become prime minister, setting up a standoff between the elite that has run the state for over a decade and thousands of Pashinyan's supporters camped on the streets.
Pashinyan, leader of a protest movement that last week forced veteran leader Serzh Sarksyan to quit as prime minister, called the Republican Party's decision an insult to the people and pledged to join his supporters on the streets.
Earlier on Tuesday, he had warned the ruling elite it could face a "tsunami" of anger from the people if it stymied his move to become prime minister.
The unexpected ouster of Sarksyan seemed to signal a dramatic shift in power in Armenia, an ex-Soviet state closely aligned to Russia that has been run by the same cadre of people since the late 1990s.
However, as a debate unfolded in parliament to discuss Pashinyan's candidacy for the vacant prime minister's post, it became clear the ruling elite was not willing to surrender power.
After several hours of debate, Pashinyan's candidacy was backed only by 45 votes in the 105-seat legislature, short of the 53 he need to become prime minister.
Shortly before the vote, a leader of the Republican Party, which is allied to Sarksyan and has the majority in parliament, said it would not back Pashinyan because he did not have the qualities required to be a prime minister.
Reacting to the announcement, Pashinyan said: "With its discussions, the Republican Party has finally and irreversibly destroyed itself. It is the ultimate category of self-destruction."
He said the party's decision was "an insult" to the people, and appealed to his supporters, gathered in a square near parliament, to wait for him to join them.
Supporters of Pashinyan, who had spent the day in the capital's Republic Square to watch the parliamentary debate on two huge screens, shouted "shame" when the result of the vote was shown.
"It showed once again that they don't care about us, about the ordinary people," said Gurgen, a 61-year-old unemployed man who was among the crowd.
Shortly after the vote, Pashinyan left parliament and headed towards the square, where tens of thousands of his supporters were gathered. As he approached on foot, accompanied by his wife, car horns honked and people in the street shouted "Nikol! Nikol!"
The crisis in ex-Soviet Armenia, which has a population of only about three million people and has Russian military bases on its territory, is being closely watched in Moscow.
Officials there are wary of a repeat of a popular revolt in Ukraine in 2014 that swept to power new leaders who pulled away from Moscow's orbit.
Protests flared when Sarksyan, an establishment veteran, announced he was seeking to become prime minister. He had previously been president, but was limited by the constitution from seeking another term.
Some Armenians saw Sarksyan's bid for the prime minister's job as a cynical ploy to extend his grip on power. Some voters accuse Sarksyan and his associates of cronyism and corruption, an allegation they deny.
Pashinyan has pledged to keep Armenia close to Moscow, saying the changes he wants to make would instead focus on rooting out graft.
During the parliamentary debate, Republican Party lawmakers accused Pashinyan or being an irresponsible rabble-rouser, they alleged he recruited children to join his protest movement, and said he lacked the qualities to command the Armenian armed forces.