Two years ago, Pavel Durov refused to grant Russian security services access to users' encrypted messages on his popular Telegram messaging app, then a favorite of Russian opposition groups. The reply from authorities was either submit or become wiped off the country's digital map.
Neither happened. Using a combination of wily cyber-dodging tactics and the force of Telegram's growing reach, the 35-year-old Russian-born entrepreneur humiliated and outmaneuvered Russia's state telecommunications regulator, Roskomnadzor.
Scores of unrelated websites were tangled up as collateral damage in Telegram's hide-and-seek with Russia's Internet minders. But, through it all, Telegram continued to work - so well that even state agencies and government officials, including Kremlin spokesman Dmitry Peskov, continued using it.
After two years of what amounted to a block in name only, Russia surrendered on June 18. It quietly closed the books on its efforts to block Telegram, which reports to have 400 million users worldwide, including roughly 30 million monthly active users in Russia.
The victory only added to the lore-making around Durov as a digital-privacy warrior and gave another boost to Telegram and its dual roles. The app functions as an encrypted cloud-based private messenger and a home for channels that allow administrators to instantly relay information to their followers.
Durov and Telegram have often been criticized for too little oversight. The app has been used by the Islamic State and white-supremacy groups. But Durov's stand in Russia could set a template for other tech companies considering countering governments' digital clampdowns.
Durov has already announced that Telegram's anti-censorship resources in Russia, called the company's Digital Resistance initiative, will be redirected to Iran and China, where Telegram is also blocked along with other sites that, at times, have included Instagram and Facebook.
Telegram "can say at face value that it seems to have won a staring contest with (Russian President Vladimir) Putin and the security state," said Philip N. Howard, director of the Oxford Internet Institute.
"It'll be good for business, and I think it'll draw people in from other countries who are facing tough dictators," he added.
This fight might have been personal for Durov. In 2006, he founded Russia's most successful social network, Vkontakte - so similar to Facebook that Durov became regularly referred to as the country's equivalent to Mark Zuckerberg.
Despite being Russia's young tech success story, he quickly landed in the Kremlin's crosshairs. In 2011, the government demanded he shut down the Vkontakte pages of opposition politicians after parliamentary elections that the European Court of Human Rights later denounced as "unfair" and "compromised."
Durov responded by posting on Twitter a picture of a dog with its tongue out. The police showed up at his St. Petersburg apartment soon after, but he wouldn't answer the door and they went home after an hour.
Then during a wave of anti-Putin protests that gripped Russia in early 2012, Durov refused to shutter groups on the site dedicated to organizing protest marches.
The following year, Durov was sought by Russian police for his role in a disputed hit-and-run that Durov and his associates claimed was part of a political attack. The charges were later downgraded, but Durov had already fled Russia. He is now a citizen of the Caribbean island nation of Saint Kitts and Nevis, though he's known for moving around.
It was around the time Durov started his so-called self-imposed exile from his home country that he learned that nearly half of VKontakte had been sold to Kremlin-friendly owners. He eventually left the company he started with his brother, claiming it was "harder and harder to remain with those principles on which our social network is based."
To keep Telegram from suffering the same fate as Vkontakte, Durov based his new company in Berlin and shrouded it in scattered global shell companies to protect it from any one government's subpoena. He also pledged never to sell it to another tech giant, despite rumors of multibillion-dollar offers. He rarely gives interviews, preferring to communicate directly to Telegram users through his own channel on the app.
"I think one of the reasons why he established and maintained Telegram, which, it seems, does not generate visible profits for him, was because he wanted to obtain the status of a U.S. tech entrepreneur," said Aliaksandr Herasimenka, a researcher at the computational propaganda project at the Oxford Internet Institute.
"Being a tech entrepreneur gives him a special status in Western countries, where he came basically as a political refugee," Herasimenka added. "But now he has become a global tech celebrity - a status that he can use to attract money from investors for his other projects."
Roskomnadzor, Russia's internet censor, had successfully banned LinkedIn in 2016 and then the messaging app Zello in 2017. Neither company put up too much of a fight, perhaps because of their limited profiles in Russia.
But Durov and Telegram dug in. The app found a clever workaround on Roskomnadzor's firewalls - essentially hiding behind Google and Amazon's hosting services to disguise the traffic source, said Andrei Soldatov, co-author of "The Red Web: The Struggle Between Russia's Digital Dictators and the New Online Revolutionaries."
Telegram kept changing its net addresses, so Roskomnadzor blocked all of the ones Telegram had used, ensnaring millions of IP addresses. The result was that Telegram continued to work, but other sites, including Twitter, Facebook and Vkontakte, suffered brief outages.
"Telegram effectively made big platforms with lots of users - companies were hosted on them - hostages," Soldatov said, adding that the digital disturbance raised the awareness of ordinary users who may not have even been on Telegram.
"Opinions were divided over the ethics of these tactics," Soldatov said. "While digital activists praised it - it made the Telegram issue a national and even international one - the Russian companies hosted on Amazon got blocked due to incompetence of Roskomnadzor. And they blamed Telegram, not the Russian authorities."
Soldatov described Russia's blocking mechanism as "primitive" and said the same tactic is unlikely to work in Iran or China, both with more sophisticated and constricting internet censorship.
Mahsa Alimardani, a researcher at the Oxford Internet Institute and British human rights organization Article 19, said Telegram was Iran's central communication platform for communication and social media with more users than Russia.
Moscow's attempts to ban Telegram had a very ironic twist - it was repeatedly undermined by government officials who continued using it. The app eventually morphed into another dissemination tool for state-sponsored news and propaganda.
Perhaps most telling was that Margarita Simonyan, the editor in chief of the government-funded TV channel RT, was an advocate. She sarcastically quipped on Twitter after the block was formally lifted: "It turns out Telegram has been blocked all of this time."
Roskomnadzor said its decision to lift the ban on the app was because Durov has said Telegram had improved its efforts to moderate and remove "extremist propaganda."
During a panel this week at the Valdai Discussion Club, a Moscow-based think tank, Alexey Volin, the deputy head of Russia's Communications Ministry, was asked whether the government's view of Telegram has changed, or whether it was ultimately just impossible to get rid of.
"I use Telegram," Volin responded with a shrug. "I used to use it, and I keep using it."