Armenian opposition leader Nikol Pashinyan addresses lawmakers during a parliament session to elect a new prime minister in Yerevan on May 8, 2018. (Karen Minasyan/AFP/Getty Images)

 Armenia’s parliament selected Nikol Pashinyan as prime minister on Tuesday, ending weeks of political unrest in the former Soviet country.

Pashinyan, 42, secured the vote after leading weeks of anti-government rallies across the country, part of a pro-democracy movement that ousted former prime minister Serzh Sargsyan after more than a decade in power. A previous vote on May 1 failed to elect Pashinyan. 

“I will serve the Armenian nation,” Pashinyan said after 59 lawmakers voted in his favor. Forty-two opposed the move.

Tens of thousands of people in the main square of the capital, Yerevan, cheered upon hearing the news, the live feed of Armenian news outlet CivilNet showed. Musicians took to the stage, where they played rock music to jubilant crowds of mostly young people, who had gathered to show their support for Pashinyan.

Armenia’s bloodless revolution — aimed at dismantling the ruling elite whom many see as corrupt — has so far avoided the aggressive response from Moscow that met the overthrow of authority in other formerly Soviet republics, notably Ukraine and Georgia.