Pashinyan's so-called Velvet Revolution has exercised true people power - the ability to conjure up a storm of support on request.
His protest movement began with a non-violent march on March 31, demanding that Sargsyan step down.
Pashinyan, 42, experienced a meteoric rise in popularity in recent weeks by appealing to Armenians of all ages.
The election of Pashinyan, a former newspaper editor who spent time in prison for fomenting unrest, marks a rupture with the cadre of rulers who have run Armenia since the late 1990s.
He promised to rid the country of what he called an oligarchic, nepotistic political system, a message that has resonated with a younger generation frustrated by a lack of opportunities.
Forced Sarksyan out
Pashinyan spearheaded a protest movement that first forced veteran leader Sarksyan to step down as prime minister, then pressured the ruling party to abandon attempts to block his election as prime minister, the country's most powerful post.
In a vote in parliament on Tuesday, 59 MPs backed Pashinyan's candidacy, including some from the ruling Republican Party, with 42 voting against.
In a vote last week, the Republican Party blocked Pashinyan, but it said on Tuesday it had decided to get behind him for the sake of unity and the good of the nation.
Republic Square in Yerevan, where Pashinyan's supporters gathered to watch the voting on huge screens, erupted into joy when the result was shown.
The tens of thousands of people in the square shouted "Nikol!" and white doves were released into the air as people hugged and kissed each other.