He failed to persuade Armenia's ruling party to support him a week ago, but opposition leader Nikol Pashinyan has now won parliament's backing to take over as the country's prime minister.

Mr Pashinyan has spearheaded weeks of protests which have brought an end to 10 years of rule by Serzh Sargsyan.

As he addressed parliament on Tuesday, thousands of supporters gathered in the capital Yerevan.

Rock star Serj Tankian of the band System of a Down earlier joined crowds.

Mr Pashinyan, who led what has become known as Armenia's "Velvet Revolution", promised MPs that human rights would be protected, and that corruption and election-rigging would end.

"All people are equal before the law. There will be no people enjoying privileges in Armenia. That's it. Full stop," he said.

Why does this matter?
A landlocked nation of 2.9 million people, Armenia is dependent on Russia for its security and has a Russian military base on its territory.

Armenia's peaceful uprising against single-party rule - and the way its political leaders responded - is seen as unprecedented for a former Soviet state. Russia has not intervened in the recent political events.

Armenia is also involved in a long-lasting conflict with Azerbaijan over the mountainous territory of Nagorno-Karabakh, an enclave with an ethnic Armenian majority that lies inside Azerbaijan's borders.

What happens next?
Mr Pashinyan won the vote by 59 votes to 42 and has promised snap elections as soon as he is happy conditions are right for a legitimate vote to take place.

He has said he has no intention to cling to power but he will first have to persuade the same parliament to approve his cabinet.

Party colleagues of Mr Pashinyan spoke in parliament on Tuesday of a "historic day". Lena Nazaryan told MPs that the revolution was a culmination of two decades of despair and struggle. "The police are now free," she said. "School teachers are free, local administrations are free."

Standing beside Mr Pashinyan the night before the vote, Mr Tankian - the lead singer of American-Armenian heavy metal band System of a Down - praised the protesters in Armenian before leading them in a traditional song. His group's songs have been played regularly at rallies since the protests began on 13 April.

How did we get here?
After 10 years in power Mr Sargsyan left Armenia's presidency last month only to be elected prime minister by a parliament controlled by his Republican party.

Mr Sargsyan's move was seen by critics as a way of clinging to office. Under a 2015 referendum marred by irregularities, Armenia shifted powers from the presidency to parliament.

Mr Pashinyan, who had begun a protest march to Yerevan ahead of the president's switch to prime minster, arrived in the capital to lead daily protests.

On 22 April he held a brief meeting with Mr Sargsyan but was then detained when the talks collapsed. The following day, he was freed and Mr Sargsyan resigned as prime minister, six days after he had been elected.

On 1 May, a parliament dominated by the ruling Republican party rejected Mr Pashinyan as prime minister, even though he was the only candidate. A general strike across Armenia took place the following day, and eventually Republican MPs agreed they would back him in an 8 May vote.