On a muggy, late spring evening, Tuan Pham awoke to the police storming his house in Hanoi, Vietnam.
They marched him to a police station and made their demand: Hand over your Facebook password. Mr. Tuan, a computer engineer, had recently written a poem on the social network called “Mother’s Lullaby,” which criticized how the communist country was run.
One line read, “One century has passed, we are still poor and hungry, do you ask why?”
Mr. Tuan’s arrest came just weeks after Facebook offered a major olive branch to Vietnam’s government. Facebook’s head of global policy management, Monika Bickert, met with a top Vietnamese official in April and pledged to remove information from the social network that violated the country’s laws.
While Facebook said its policies in Vietnam have not changed, and it has a consistent process for governments to report illegal content, the Vietnamese government was specific. The social network, they have said, had agreed to help create a new communications channel with the government to prioritize Hanoi’s requests and remove what the regime considered inaccurate posts about senior leaders.
Populous, developing countries like Vietnam are where the company is looking to add its next billion customers — and to bolster its ad business. Facebook’s promise to Vietnam helped the social media giant placate a government that had called on local companies not to advertise on foreign sites like Facebook, and it remains a major marketing channel for businesses there.
The diplomatic game that unfolded in Vietnam has become increasingly common for Facebook. The internet is Balkanizing, and the world’s largest tech companies have had to dispatch envoys to, in effect, contain the damage such divisions pose to their ambitions.
The internet has long had a reputation of being an anything-goes place that only a few nations have tried to tame — China in particular. But in recent years, events as varied as the Arab Spring, elections in France and confusion in Indonesia over the religion of the country’s president have awakened governments to how they have lost some control over online speech, commerce and politics on their home turf.
Even in the United States, tech giants are facing heightened scrutiny from the government. Facebook recently cooperated with investigators for Robert S. Mueller III, the special counsel investigating Russian interference in the American presidential election. In recent weeks, politicians on the left and the right have also spoken out about the excess power of America’s largest tech companies.
As nations try to grab back power online, a clash is brewing between governments and companies. Some of the biggest companies in the world — Google, Apple, Facebook, Amazon and Alibaba among them — are finding they need to play by an entirely new set of rules on the once-anarchic internet.
And it’s not just one new set of rules. According to a review by The New York Times, more than 50 countries have passed laws over the last five years to gain greater control over how their people use the web.
“Ultimately, it’s a grand power struggle,” said David Reed, an early pioneer of the internet and a former professor at the M.I.T. Media Lab. “Governments started waking up as soon as a significant part of their powers of communication of any sort started being invaded by companies.”
Facebook encapsulates the reasons for the internet’s fragmentation — and increasingly, its consequences.
The company has become so far-reaching that more than two billion people — about a quarter of the world’s population — now use Facebook each month. Internet users (excluding China) spend one in five minutes online within the Facebook universe, according to comScore, a research firm. And Mark Zuckerberg, Facebook’s chief executive, wants that dominance to grow.
But politicians have struck back. China, which blocked Facebook in 2009, has resisted Mr. Zuckerberg’s efforts to get the social network back into the country. In Europe, officials have repudiated Facebook’s attempts to gather data from its messaging apps and third-party websites.
The Silicon Valley giant’s tussle with the fracturing internet is poised to escalate. Facebook has now reached almost everyone who already has some form of internet access, excluding China. Capturing those last users — including in Asian nations like Vietnam and African countries like Kenya — may involve more government roadblocks.
“We understand that and accept that our ideals are not everyone’s,” said Elliot Schrage, Facebook’s vice president of communications and public policy. “But when you look at the data and truly listen to the people around the world who rely on our service, it’s clear that we do a much better job of bringing people together than polarizing them.”
By mid-2016, a yearslong campaign by Facebook to get into China — the world’s biggest internet market — appeared to be sputtering.
Mr. Zuckerberg had wined and dined Chinese politicians, publicly showed off his newly acquired Chinese-language skills — a moment that set the internet abuzz — and talked with a potential Chinese partner about pushing the social network into the market, according to a person familiar with the talks who declined to be named because the discussions were confidential.
At a White House dinner in 2015, Mr. Zuckerberg had even asked the Chinese president, Xi Jinping, whether Mr. Xi might offer a Chinese name for his soon-to-be-born first child — usually a privilege reserved for older relatives, or sometimes a fortune teller. Mr. Xi declined, according to a person briefed on the matter.
But all those efforts flopped, foiling Facebook’s attempts to crack one of the most isolated pockets of the internet.
China has blocked Facebook and Twitter since mid-2009, after an outbreak of ethnic rioting in the western part of the country. In recent years, similar barriers have gone up for Google services and other apps, like Line and Instagram.
Even if Facebook found a way to enter China now, it would not guarantee financial success. Today, the overwhelming majority of Chinese citizens use local online services like Qihoo 360 and Sina Weibo. No American-made apps rank among China’s 50 most popular services, according to SAMPi, a market research firm.
Chinese tech officials said that although many in the government are open to the idea of Facebook releasing products in China, there is resistance among leaders in the standing committee of the country’s Politburo, its top decision-making body.
In 2016, Facebook took tentative steps toward embracing China’s censorship policies. That summer, Facebook developed a tool that could suppress posts in certain geographic areas, The Times reported last year. The idea was that it would help the company get into China by enabling Facebook or a local partner to censor content according to Beijing’s demands. The tool was not deployed.
In another push last year, Mr. Zuckerberg spent time at a conference in Beijing that is a standard on the China government relations tour. Using his characteristic brand of diplomacy — the Facebook status update — he posted a photo of himself running in Tiananmen Square on a dangerously smoggy day. The photo drew derision on Twitter, and concerns from Chinese about Mr. Zuckerberg’s health.
For all the courtship, things never quite worked out.
“There’s an interest on both sides of the dance, so some kind of product can be introduced,” said Kai-Fu Lee, the former head of Google in China who now runs a venture-capital firm in Beijing. “But what Facebook wants is impossible, and what they can have may not be very meaningful.”
This spring, Facebook tried a different tactic: testing the waters in China without telling anyone. The company authorized the release of a photo-sharing app there that does not bear its name, and experimented by linking it to a Chinese social network called WeChat.
One factor driving Mr. Zuckerberg may be the brisk ad business that Facebook does from its Hong Kong offices, where the company helps Chinese companies — and the government’s own propaganda organs — spread their messages. In fact, the scale of the Chinese government’s use of Facebook to communicate abroad offers a notable sign of Beijing’s understanding of Facebook’s power to mold public opinion.
Chinese state media outlets have used ad buys to spread propaganda around key diplomatic events. Its stodgy state-run television station and the party mouthpiece newspaper each have far more Facebook “likes” than popular Western news brands like CNN and Fox News, a likely indication of big ad buys.
To attract more ad spending, Facebook set up one page to show China’s state broadcaster, CCTV, how to promote on the platform, according to a person familiar with the matter. Dedicated to Mr. Xi’s international trips, the page is still regularly updated by CCTV, and has 2.7 million likes. During the 2015 trip when Mr. Xi met Mr. Zuckerberg, CCTV used the channel to spread positive stories. One post was titled “Xi’s UN address wins warm applause.”
Fittingly, Mr. Zuckerberg’s eagerness and China’s reluctance can be tracked on Facebook.
During Mr. Xi’s 2015 trip to America, Mr. Zuckerberg posted about how the visit offered him his first chance to speak a foreign language with a world leader. The post got more than a half million likes, including from Chinese state media (despite the national ban). But on Mr. Xi’s propaganda page, Mr. Zuckerberg got only one mention — in a list of the many tech executives who met the Chinese president.
Europe’s Privacy Pushback
Last summer, emails winged back and forth between members of Facebook’s global policy team. They were finalizing plans, more than two years in the making, for WhatsApp, the messaging app Facebook had bought in 2014, to start sharing data on its one billion users with its new parent company. The company planned to use the data to tailor ads on Facebook’s other services and to stop spam on WhatsApp.
A big issue: how to win over wary regulators around the world.
Despite all that planning, Facebook was hit by a major backlash. A month after the new data-sharing deal started in August 2016, German privacy officials ordered WhatsApp to stop passing data on its 36 million local users to Facebook, claiming people did not have enough say over how it would be used. The British privacy watchdog soon followed.
By late October, all 28 of Europe’s national data-protection authorities jointly called on Facebook to stop the practice. Facebook quietly mothballed its plans in Europe. It has continued to collect people’s information elsewhere, including the United States.
“There’s a growing awareness that people’s data is controlled by large American actors,” said Isabelle Falque-Pierrotin, France’s privacy regulator. “These actors now know that times have changed.”
Facebook’s retreat shows how Europe is effectively employing regulations — including tough privacy rules — to control how parts of the internet are run.
The goal of European regulators, officials said, is to give users greater control over the data from social media posts, online searches and purchases that Facebook and other tech giants rely on to monitor our online habits.
As a tech company whose ad business requires harvesting digital information, Facebook has often underestimated the deep emotions that European officials and citizens have tied into the collection of such details. That dates back to the time of the Cold War, when many Europeans were routinely monitored by secret police.
Now, regulators from Colombia to Japan are often mimicking Europe’s stance on digital privacy. “It’s only natural European regulators would be at the forefront,” said Brad Smith, Microsoft’s president and chief legal officer. “It reflects the importance they’ve attached to the privacy agenda.”
In interviews, Facebook denied it has played fast and loose with users’ online information and said it complies with national rules wherever it operates. It questioned whether Europe’s position has been effective in protecting individuals’ privacy at a time when the region continues to fall behind the United States and China in all things digital.
Still, the company said it respected Europe’s stance on data protection, particularly in Germany, where many citizens have long memories of government surveillance.
“There’s no doubt the German government is a strong voice inside the European community,” said Richard Allen, Facebook’s head of public policy in Europe. “We find their directness pretty helpful.”
Europe has the law on its side when dictating global privacy. Facebook’s non-North American users, roughly 1.8 billion people, are primarily overseen by Ireland’s privacy regulator because the company’s international headquarters is in Dublin, mostly for tax reasons. In 2012, Facebook was forced to alter its global privacy settings — including those in the United States — after Ireland’s data protection watchdog found problems while auditing the company’s operations there.
Three years later, Europe’s highest court also threw out a 15-year-old data-sharing agreement between the region and the United States following a complaint that Facebook had not sufficiently protected Europeans’ data when it was transferred across the Atlantic. The company denies any wrongdoing.
And on Sept. 12, Spain’s privacy agency fined the company 1.2 million euros for not giving people sufficient control over their data when Facebook collected it from third-party websites. Watchdogs in Germany, the Netherlands and elsewhere are conducting similar investigations. Facebook is appealing the Spanish ruling.
“Facebook simply can’t stick to a one-size-fits-all product around the world,” said Max Schrems, an Austrian lawyer who has been a Facebook critic after filing the case that eventually overturned the 15-year-old data deal.
Potentially more worrying for Facebook is how Europe’s view of privacy is being exported. Countries from Brazil to Malaysia, which are crucial to Facebook’s growth, have incorporated many of Europe’s tough privacy rules into their legislation.
“We regard the European directives as best practice,” said Pansy Tlakula, chairwoman of South Africa’s Information Regulator, the country’s data protection agency. South Africa has gone so far as to copy whole sections, almost word-for-word, from Europe’s rule book.
The Play for Kenya
Blocked in China and troubled by regulators in Europe, Facebook is trying to become “the internet” in Africa. Helping get people online, subsidizing access, and trying to launch satellites to beam the internet down to the markets it covets, Facebook has become a dominant force on a continent rapidly getting online.
But that has given it a power that has made some in Africa uncomfortable.
Some countries have blocked access, and outsiders have complained Facebook could squelch rival online business initiatives. Its competition with other internet companies from the United States and China has drawn comparisons to a bygone era of colonialism.
For Kenyans like Phyl Cherop, 33, an entrepreneur in Nairobi, online life is already dominated by the social network. She abandoned her bricks-and-mortar store in a middle-class part of the city in 2015 to sell on Facebook and WhatsApp.
“I gave it up because people just didn’t come anymore,” said Ms. Cherop, who sells items like designer dresses and school textbooks. She added that a stand-alone website would not have the same reach. “I prefer using Facebook because that’s where my customers are. The first thing people want to do when they buy a smartphone is to open a Facebook account.”
As Facebook hunts for more users, the company’s aspirations have shifted to emerging economies where people like Ms. Cherop live. Less than 50 percent of Africa’s population has internet connectivity, and regulation is often rudimentary.
Since Facebook entered Africa about a decade ago, it has become the region’s dominant tech platform. Some 170 million people — more than two thirds of all internet users from South Africa to Senegal — use it, according Facebook’s statistics. That is up 40 percent since 2015.
The company has struck partnerships with local carriers to offer basic internet services — centered on those offered by Facebook — for free. It has built a pared-down version of its social network to run on the cheaper, less powerful phones that are prevalent there.
Facebook is also investing tens of millions of dollars alongside telecom operators to build a 500-mile fiber-optic internet connection in rural Uganda. In total, it is working with about 30 regional governments on digital projects.
“We want to bring connectivity to the world,” said Jay Parikh, a Facebook vice president for engineering who oversees the company’s plans to use drones, satellites and other technology to connect the developing world.
Facebook is racing to gain the advantage in Africa over rivals like Google and Chinese players including Tencent, in a 21st century version of the “Scramble for Africa.” Google has built fiber internet networks in Uganda and Ghana. Tencent has released WeChat, its popular messaging and e-commerce app, in South Africa.
Facebook has already hit some bumps in its African push. Chad blocked access to Facebook and other sites during elections or political protests. Uganda also took legal action in Irish courts to force the social network to name an anonymous blogger who had been critical of the government. Those efforts failed.
In Kenya, one of Africa’s most connected countries, there has been less pushback.
Facebook expanded its efforts in the country of 48 million in 2014. It teamed up with Airtel Africa, a mobile operator, to roll out Facebook’s Free Basics — a no-fee version of the social network, with access to certain news, health, job and other services there and in more than 20 other countries worldwide. In Kenya, the average person has a budget of just 30 cents a day to spend on internet access.
Free Basics now lets Kenyans use Facebook and its Messenger service at no cost, as well as read news from a Kenyan newspaper and view information about public health programs. Joe Mucheru, Kenya’s tech minister, said it at least gives his countrymen a degree of internet access.
Still, Facebook’s plans have not always worked out. Many Kenyans with access to Free Basics rely on it only as a backup when their existing smartphone credit runs out.
“Free Basics? I don’t really use it that often,” said Victor Odinga, 27, an accountant in downtown Nairobi. “No one wants to be seen as someone who can’t afford to get online.”