In between the two was Pavel Durov, who founded and ran the most popular social network in Russia – until it was taken over by Kremlin cronies. In his trademark black suit and a black baseball cap he looked a little austere for the neighborhood.

"We're a long way from Moscow," he said, apparently resigned to his new life in exile.

Pavel Durov

Dustin Drankoski/Mashable

Durov's journey to this New York rooftop had begun four years earlier. In December 2011, he was home alone when armed men in camouflage fatigues began rapping violently on the door of his St. Petersburg apartment. Peering through the windows, he saw he was surrounded. The men shouted to be let in.

Days earlier, Durov, founder of the social network VKontakte, had denied a request from the security services to block political opposition groups from using his network to organize anti-government protests in Moscow.

The Kremlin had wanted him to shut down the pages of one activist in particular: Alexei Navalny who had become famous for his blog that exposed the corrupt schemes and lavish lifestyles of some of the country's top officials.

Navalny's VK page that Durov refused to take down.

Sovfoto/ITAR-TASS

Not only did Durov refuse to comply with the government’s order to take down Navalny’s pages – he flaunted his defiance by tweeting an image of a dog wearing a blue hoodie and wagging its tongue toward the camera.

Durov's contempt didn't go unnoticed. Soon agents from the FSB, successor to the Soviet-era KGB, came to confront him, carrying automatic rifles. Durov refused to let them in and, to his surprise, they left an hour later. But the incident terrified the young entrepreneur.

"I was really scared," Durov admitted recently in New York, during a rare interview. "For the first time I thought, ‘maybe I should think about the future - the future of my country and of my company.’"

It marked the beginning of a nearly four years-long fight against Russian authorities that Durov eventually lost. In 2014, the man once known as ‘Russia’s Mark Zuckerberg’ was forced to relinquish control of the company he founded to wealthy Kremlin loyalists. Soon after he left Russia.

Today, the 30-year-old lives in a restless exile, a global nomad in perpetual movement, contemplating the choices he made.

VKontakte, meaning "in contact," is Russia's most popular social network, dwarfing Facebook and Twitter in Russia with its more than 69 million monthly users.

Created in 2006 while Durov was still a linguistics student at St. Petersburg State University, VKontakte closely resembles Facebook and indeed at first Durov was accused of lifting the look of the American social network, which his business partner, Vyacheslav Mirilashvili, had discovered while studying at Tufts University. (At the time, Facebook was limited to users with American university e-mail addresses.)

To write the code for VKontakte, the two had enlisted the help of Durov's brother, Nikolai, a distinguished mathematician and programmer, and the network quickly became popular as a way to share all types of media, particularly pirated films and music, thanks to Russia's hazy copyright laws.

Durov, who denies he took much inspiration from Facebook, calls the social network he built "a place of complete freedom for the distribution of all information and media.”

VKontakte was a success with millions of users logging in everyday.

Misha Japaridze/AP

Russia's early adopters loved VKontakte and in less than a year it became the country's most popular social network as well as one of the largest hosting services in Europe. For his part, Durov, at 22, became a multimillionaire celebrity – a role he seemed to relish.

With pale skin, slick dark hair and all-black clothes, Durov resembles Neo as portrayed by Keanu Reeves in "The Matrix," and with his outré behavior and bad-boy good looks he quickly became a staple of the gossip columns in Moscow and St. Petersburg.

But his publicity stunts weren’t always well-received.

In 2012, he was criticized for what appeared to be an act of thoughtless ostentation after he flew paper airplanes made of 5,000 ruble notes (about $157) from the windows of his company St. Petersburg offices and scuffles broke out on the Nevsky Prospekt below as people fought over the money.

Earlier that month, on Victory Day when Russians celebrate their defeat of the Nazis, Durov wrote that the Soviet leader Josef Stalin had "defended from Hitler his right to suppress Soviet people," a satirical remark that drew the ire of many Russians at a time of mounting nationalism.

But the young entrepreneur didn't seem to care.

If he has one guiding principle, it is this: "I never want things to be dull."

The Singer House building where VKontakte's offices are located.

Anatoly Matsev/EPA

Vladimir Putin, who has called the collapse of the Soviet Union "the greatest geopolitical tragedy of the 20th century," had taken office in 2000 with a promise to restore Russia's greatness as well as its reputation as a global superpower.

At first, he cared little for technology or what happened on the Internet, famously once dismissing it as "half pornography."

For years there was little regulation of the web. "It was the golden era for the Internet in Russia," says Durov.

Durov speaking during the Digital Life Design conference in Germany in 2012.

Nadine Rupp/Getty Images

But by 2011, as people got together online to organize demonstrations in Moscow to protest against what they saw as rigged parliamentary elections, the Kremlin woke up to the significance of the web as a tool for social organization.

Vladislav Surkov, who shaped the Kremlin’s media strategy and whose access to Putin's inner circle had earned him the nickname the ‘Gray Cardinal,’ had before seemed friendly to Durov. The two had met on several occasions between 2009 and 2011 at VKontakte's St. Petersburg headquarters.

During their first meeting, Surkov wanted to know how Russia could make the technological leap forward and “what the next great Internet inventions could be," Durov says. At their last meeting some two years later, however, Surkov was “reserved” and “tense,” according to Durov.

The Kremlin.

Ivan Vdovin/JAI/Corbis

Behind the tall, red walls of the Kremlin, conservatives had started to plot about how best to control the flow of information on the Internet in Russia – and how to bring people such as Durov to heel.

"The opinion of the blogosphere is having a growing influence over the most serious political, economics and social processes," a Kremlin official said at the time. "There are information wars being waged here aimed at undermining people's trust in the state."

In late 2011, the Kremlin demanded that VKontakte block the pages under Navalny’s control, and Durov responded with his dog photo tweet. And when one of Navalny's event pages was locked after more than 100,000 users subscribed in a short amount of time, Durov changed the social network's algorithm to allow more people to sign up.

Today, Durov says he did it purely for business reasons. Had he complied with the government order, the VKontakte users would have gone to another network, he says.

"He never expected he'd play a political role,” Soldatov says. “But he became unwillingly involved in a political struggle."

Kevin Rothrock, editor-in-chief of RuNet Echo, part of the nonprofit citizen journalism network Global Voices Online that covers the Russian Internet, says Durov's open disregard for the government's requests is likely one reason he found himself in the Kremlin's crosshairs.

"The argument could be made that Durov forced the Kremlin's hand with his public defiance," Rothrock says.

Whatever the case, Russian lawmakers passed a series of laws over the next three years aimed at widening the Kremlin’s control of the Internet in Russia. And though political protests had died down by early 2012, Durov was now on the security services’ radar.

Durov posted this image to Instagram in response to Mail.Ru's attempts to acquire VKontakte.

Russian Look/ZUMAPRESS.com

By early 2013, they came after the entrepreneur with what appeared a well-coordinated smear campaign. It began with the publication in Russian media of a series of alleged "hacked" emails between Durov and the Kremlin strategist Surkov that claimed to show VKontakte had long been cooperating with the FSB, something Durov insists "never happened."

Then on April 5, the state prosecutor's office launched a criminal investigation into charges that Durov had run over a policeman's foot while driving a white Mercedes registered to Ilya Perekopsky, a VKontakte vice president.

"At first I thought, 'this is a joke,’” Durov says. “It was completely fake.”

But the Investigative Committee, the equivalent of the FBI in Russia, soon got involved. Less than two weeks later, investigators came to the Singer House headquarters and seized the company files of VKontakte.

"I began to understand then that this was political,” Durov says.

The Kremlin “was coming after me.”

The morning after authorities raided VKontakte, Durov awoke to news that two original investors, Vyacheslav Mirilashvili and Lev Leviev, had sold their joint 48% stake in the company (then valued at around $2 billion) to United Capital Partners (UCP), a private Moscow investment firm with close ties to the Kremlin. (Until that moment, UCP hadn’t invested in tech companies, concentrating instead on financial services, oil and gas and petrochemicals.)

The deal, it turned out, had been orchestrated by Igor Sechin, head of the Russian oil giant Rosneft, a Putin loyalist and one of Russia's most powerful men. Durov says the sale was illegal because he was never asked about it and existing shareholders held pre-emptive rights to buy VKontakte shares under the company's charter.

UCP spokesperson Nafisa Nasyrova said by email that the deal wasn't politically motivated.

"We are a private equity investor and our investment had nothing to do with the Kremlin, politics or Mr.Sechin."

Durov felt the authorities were out to get him and decided to flee Saint Petersburg, first for Venice and later New York.

For months, he stayed underground, only returning to Russia after the charges against him were downgraded to a fine in June of 2013.

He had lost control of VKontakte but NSA whistleblower Edward Snowden's flight to Moscow that year combined with his own experience with the Russian authorities had given him a new business idea: an encrypted messaging app called Telegram.

"We learned that [security] isn't just our problem in Russia,” he says, “it's a global concern."

Putin sits down with Igor Sechin, CEO of Rosneft which purchased 48% of VKontakte.

Mikhail Klimentyev/Ria-Novosti/AP

On Jan. 20, 2014, rumors began circulating in Moscow that Durov had resigned as head of VKontakte. The company denied it. But four days later, Durov confirmed that he had sold his remaining 12% stake in the company to Ivan Tavrin, CEO of mobile operator Megafon, a company that is part of USM Holdings, which in turn is headed by billionaire Alisher Usmanov, another Putin loyalist, and is the biggest shareholder in Russian Internet group Mail.Ru. While Durov stayed on as director general of VKontakte, the company was now under the complete control of two Putin cronies. (USM Holdings and Mail.Ru did not respond to requests for comment.)

In February, Durov shared a video in support of pro-Western protesters in Ukraine to his 6 million followers on VKontakte. Shortly after, the Kremlin requested data about Ukrainian users of VKontakte who had posted similar messages of support for the demonstrators.

On April 1, Durov posted a message to VKontakte, saying he was quitting the company. He appeared to regret his resignation two days later, calling it an April Fools' joke. But three weeks later, the official word from the company he'd founded and built was that he'd been fired.

Durov has a slightly different take.

"It was time to get out because at that point I had no power within the company," he says.

And so he fled Russia again. But this time he didn't look back.

Durov at Mashable's New York City offices in May 2015.

Dustin Drankoski/Mashable

Today Durov appears relieved.

"Right now I can live and work wherever I want," he says, seemingly relishing his new-found freedom. "I'm in a situation where I can determine my own future."

His secure messaging app Telegram, which is free and carries no ads, has become immensely popular. So far, Telegram has about 50 million users, most of them outside Russia, though it’s clear some inside the Kremlin do use the app, including Putin's official spokesperson, Dmitry Peskov. (Peskov declined to speak about why he uses the app.)

The Electronic Frontier Foundation, the U.S.-based digital rights group, gave Telegram's "secret chats" function seven out of seven on its secure messaging scorecard.

Durov insists there are no outside investors involved in Telegram – and there never will be. He has learned his lesson from VKontakte.

Meanwhile, Russian authorities continue their crackdown on freedom online. Lawmakers pushed through a bill requiring Internet companies that keep personal data on Russian citizens to store it within the country's borders. The Kremlin has also said it’s considering the creation of a ‘kill switch’ to unplug the country from the Internet "in case of an emergency."

Last December, the Russian authorities ordered Facebook to block a protest page related to Navalny – and the American company complied with the government's request, blocking access for users in Russia.

Durov tweeted that "Facebook has no guts and no principles."

For his own part, he says, "I will never comply with such a request from any government."