On March 31, Mr. Pashinyan, 42, a balding man with a salt-and-pepper beard and slight paunch, began a quixotic walk across central Armenia to protest an effort by the president to skirt term limits.
Few paid much attention at first. Yet within three weeks, Mr. Pashinyan, a former newspaper editor and political prisoner, had galvanized a civil disobedience movement that transformed the country’s political landscape. It forced the retirement of Serzh Sargsyan, the president for the past decade, and shoved aside the long-dominant Republican Party.
It was the most sweeping change in this small, landlocked country of about 2.8 million people in the southern Caucasus since it declared independence from the Soviet Union in 1991.
Mr. Pashinyan’s election on Tuesday was all the more remarkable because it happened in the backyard of President Vladimir V. Putin of Russia, who sent his congratulations.
Popular protests tend to alarm Mr. Putin, and he has invaded other former Soviet states, Georgia and Ukraine, where he saw Russian interests and influence being threatened. Russia considers Armenia of such strategic importance that it maintains a military base in the country, and helps guard Armenia’s borders with Turkey and Iran.
But by focusing on strictly domestic problems while pledging eternal brotherhood with Moscow, Mr. Pashinyan deftly avoided a military intervention by the Kremlin.
“There are no foreign forces involved in this process,” Mr. Pashinyan said over lunch. “I have insisted many times that there is no geopolitical context to our movement, our velvet revolution.”
If many Armenians find it nothing short of miraculous that their country seems transformed overnight, Mr. Pashinyan described it as the culmination of a journey that began some 20 years ago.
As a journalism student at Yerevan State University, he wrote screeds against corruption, and was expelled in 1995 before he could graduate.
He later become the editor in chief of the newspaper Haykakan Zhamanak, where he continued polemical attacks against politicians and rich businessmen. His car, a Lada Niva, was set on fire outside the newspaper’s offices in 2004.
In 2008, he helped organize street protests against what many considered a tainted presidential election. Some still blame him for bloody clashes that resulted in the deaths of 10 people, although he denies provoking the violence.
“I didn’t trust him,” said Anahit Sahakyan, 42, the owner of the bohemian Ilik cafe in central Yerevan. “He would shout, ‘They treat you like slaves! They treat you like dogs!’ He was trying to arouse the animal instincts in people. I didn’t like it.”
Wanted by the government, Mr. Pashinyan went on the lam for 16 months. “That was the hardest time we experienced,” said his wife, Anna Hakobyan, 40, who met him in journalism school. A security services officer moved into their apartment, in case he showed up.
With Mr. Pashinyan in hiding, Ms. Hakobyan took over the newspaper, while also caring for their three children; they now have four. She did not see him for six months, but she heard from him — he sent notes accusing her of destroying the paper, along with occasional praise.
“That was stressful,” she said, laughing.
Eventually, she would visit him for a few days, changing cars as she moved across Yerevan to lose the officers tailing her. “Just like the movies,” she said.
In 2009, Mr. Pashinyan turned himself in, and was sentenced to seven years in prison, thrown in with violent criminals. One night, two masked men entered his cell and kicked him to the ground.
“I am proud that I experienced it and was able to stay true to myself in that strange environment under all different kinds of pressure,” he said. He learned English and read a lot.
When he returned to their modest, two-bedroom, fourth-floor walk-up after a 2011 amnesty, he was a stranger to their daughter, Shushan, who had been an infant when he was locked up. “What is Daddy for?” she asked, puzzled.
Elected to Parliament in 2012, he joined a weak alliance of nine opposition members. He infuriated many opposition activists in 2015 by not opposing the governing party’s move to alter the Constitution, shifting most presidential powers to the prime minister.
Last month, term limits forced Mr. Sargsyan to step down as president, but he held onto power by having Parliament elect him prime minister, despite his pledge not to seek that office. When his plan became clear, Mr. Pashinyan began preparing his protest.
“I understood that the best way to prevent violence is to be nonviolent,” he said. Drawing inspiration from Nelson Mandela and from Gandhi’s famous 1930 walk across India to protest British taxation, Mr. Pashinyan decided to walk around 120 miles across Armenia from Gyumri, the second-largest city, to Yerevan.
Opponents mocked him for wearing a camouflage-pattern T-shirt, accusing him of trying to disguise his lack of military service. He laughed off the criticism, and the shirt became a signature.
His beard and clothes set him apart from the slick haircuts and suits favored by the governing party. His supporters saw his look as fitting for a man they described as down-to-earth, smart, spontaneous and far less volatile then he had been in his youth.
Students were already protesting by the time he reached Yerevan on April 13, and the crowds grew with each step the government took. On April 17, Mr. Sargsyan became prime minister, and on April 22 he tried to decapitate the protest movement by having Mr. Pashinyan detained.
Instead, hundreds of thousands of Armenians took to the streets, shouting “Nikol! Nikol!” Bowing to pressure, Mr. Sargsyan stepped down.
The demonstrations swelled, with Mr. Pashinyan, again free, stressing that if the police used force, protesters should just raise their hands and surrender. He told the police repeatedly that they were friends and fellow Armenians.
Many of those who had been skeptical became supporters. “He is one of the few political guys in Armenia who really changed,” said Samvel Martirosyan, a specialist in internet security and a veteran political observer. “He became smarter, calmer, he speaks really well.”
On May 1, the governing party, which holds 58 out of 105 seats in Parliament, voted down his bid to become interim prime minister. So Mr. Pashinyan went to Yerevan’s central Republic Square, the throbbing heart of the protests, where an estimated 250,000 people had gathered, and called for a nationwide strike at 8:15 the next morning.
Supporters brought the country to a halt, joking that it was a measure of Mr. Pashinyan’s influence that he could make Armenians do things on time.
Parliament met again on Tuesday to choose a leader, and this time Mr. Pashinyan prevailed. He said his first priority was to organize the first fair parliamentary elections in many years.
Mr. Pashinyan has vowed to break up the cozy system of oligarchic monopolies and invigorate an economy that has left a third of the country in poverty. After 30 years of fighting with Azerbaijan over Nagorno-Karabakh, a region both countries claim, he has said he will make the enclave part of Armenia.
He brushes aside fears that he has set expectations so high that he is bound to disappoint.
“I am in a working mood, there is no sense of euphoria, just work to do,” Mr. Pashinyan said. “If we were able to do the impossible, that means we will be able to do the difficult.”
Continue reading the main story