When Microsoft opened an advanced research laboratory in Beijing in 1998, it was a time of optimism about technology and China.

The company hired hundreds of researchers for the lab, which pioneered Microsoft’s work in facial, image and voice recognition and the type of artificial intelligence that later gave rise to online chatbots like ChatGPT. The Beijing operation eventually became one of the most important artificial intelligence laboratories in the world. Bill Gates, co-founder of Microsoft, called It is an opportunity to tap into China’s “vast pool of intellectual talent.”

But as tensions rise between the United States and China over which nation will lead the world’s technological future, Microsoft’s top leaders – including Satya Nadella, its CEO, and Brad Smith, its president – have debated what to do with the precious lab for at least last year, four current and former Microsoft employees said.

The company has faced questions from U.S. officials about whether it is sustainable to maintain a 200-person advanced technologies lab in China, the people said. Microsoft said it had instituted security barriers at the lab, restricting researchers from doing politically sensitive work.

The company, based in Redmond, Washington, said it had also opened a laboratory base in Vancouver, British Columbia, and would move some researchers from China to the site. The outpost is a backup in case more researchers need to relocate, two people said. The idea of ​​closing or moving the lab has been floated, but Microsoft leaders support keeping it in China, four people said.

“We are as committed as ever to this team’s world-class lab and research,” Peter Lee, who heads Microsoft Research, a network of eight labs around the world, said in a statement. Using the lab’s formal name, he added: “There has been no discussion or advocacy to close Microsoft Research Asia, and we look forward to continuing our research agenda.”

The debate at Microsoft stands out because the company is one of the few major U.S. tech firms (along with Apple and Tesla) that maintains a foothold in China. As China fostered a domestic tech industry and geopolitical tensions with the United States rose, American companies like Google reduced their presence there. Facebook and other American social media sites like X have been blocked in China for years.

Microsoft-owned LinkedIn shut down its professional social network in China in 2021, citing growing compliance demands. But Microsoft has kept its Bing search engine as the only foreign search engine in China, although it is heavily censored, and offers its Windows operating system, cloud computing and applications there for corporate clients.

Microsoft has debated the future of the lab for several years, five people with knowledge of the situation said. It has become a target of national security concerns amid the rise of AI and growing aggression between the United States and China. Hypothetical risks are that China could hack or otherwise infiltrate the lab, or that its researchers could leave Microsoft to join Chinese companies that work closely with the government, the people said.

The Biden administration privately asked Microsoft about the lab as it drafted a ban over the past two years on new U.S. investments in companies building sensitive technologies in China that Beijing could use to upgrade its military, two people familiar with the talks said. (The proposed rules, published in August, are not yet final.)

Senators asked Mr. Smith about Microsoft’s ties to China in a subcommittee hearing on AI in September. He said the country accounted for 1.5 percent of Microsoft’s sales, which totaled $212 billion last fiscal year.

Microsoft faces “a complicated balance,” said Chris Miller, author of “Chip War,” a book that traces the geopolitical history of technology. “They need to consider where trust in the political system is going.”

The White House declined to comment.

Microsoft’s Beijing lab was born when Gates appointed Kai-Fu Lee, a Taiwan-born AI researcher, to build the operation. (Dr. Lee later left to join Google and now runs a venture capital firm.)

The lab’s researchers, many of whom were at the top of their field, explored technologies such as speech recognition, computer vision and natural language understanding, which are cornerstones in the development of artificial intelligence. Some of the lab’s researchers have gone on to key positions at Chinese tech giants such as Alibaba, Baidu and Tencent or helped found startups such as Megvii, a facial recognition company that has contributed to a vast national surveillance system in the country.

In 2018, Microsoft said it had invested more than a billion dollars in research and development in China over the previous decade. The Beijing lab’s technical talent and invention underpin a key internal argument to support it.

But the lab’s success and prestige also attracted attention in Washington, where the White House has increasingly restricted China’s access to crucial technologies, citing national security.

Microsoft leaders have discussed how to manage tensions. Gates, who is still in regular contact with company executives and supports global engagement, has long supported the Beijing lab, people with knowledge of the matter said. He traveled to China in June and met with President Xi Jinping, who told him he was “the first American friend I met this year.”

Microsoft technology and research leaders, including Peter Lee and Kevin Scott, the chief technology officer, also support the lab, arguing that it has produced critical technological advances, two people said. Mr. Smith also supports the lab.

“The lesson of history is that countries succeed when they learn from the world,” Smith said in a statement. “Guardrails and controls are essential, while engagement remains vital.”

In recent years, Microsoft has limited the projects that researchers in China can work on, people with knowledge of the matter said. Last fall, researchers in China were not allowed to be part of the small Microsoft teams that had early access to GPT-4, the advanced artificial intelligence system developed by Microsoft partner OpenAI, they said.

The lab also has restrictions on work related to quantum computing, facial recognition and synthetic media, Microsoft said. The company also blocks hiring or working with students and researchers from universities affiliated with China’s military, he said.

(The New York Times sued OpenAI and Microsoft last month for copyright infringement over the training of their AI systems.)

At the Vancouver lab’s outpost, researchers can have free access to critical technologies, including the computing power and OpenAI systems needed for cutting-edge research, two people with knowledge of the lab said.

Kate Conger contributed reporting from San Francisco.

Audio produced by sara diamond.