White House adviser Peter Navarro, one of the top administration opponents to the TikTok deal, to argue that Microsoft may not be the best suitor for the unit of China-based ByteDance Ltd., or that Microsoft should perhaps be made to divest its Chinese holdings should it acquire TikTok in the US.聽

Microsoft Corp.鈥檚 attempt to buy TikTok鈥檚 US operations represents the latest step in a careful dance the software maker has performed to meet the demands of the Chinese and US governments while doing business in both places, a balancing act that has grown increasingly fraught in the political conflict between the countries.

China hawks in the Trump administration oppose any purchase of the social-media service by Microsoft, which wants the popular app to expand its consumer internet business in the US. But the company also wants to maintain its robust business in China, the world鈥檚 most populous country.

Microsoft entered China in 1992, helping to engineer the government鈥檚 computer systems and installing special versions of Windows operating systems that would comply with the country鈥檚 censorship controls. Early on, the company launched a massive research operation in China, churning out a feeder system of tech executives who would go on to start or work at many of China鈥檚 biggest tech companies. The large presence endeared the Redmond, Washington-based company to Chinese officials, who allowed Microsoft to maintain the only major Western-run search engine and social media companies in Bing and LinkedIn, albeit censored versions.

The company also operates cloud services under a joint venture with a Chinese company and its Xbox console was the first of that type of video-game device approved for sale in China, again through a joint venture. In September, Microsoft president Brad Smith criticized US President Donald Trump and his administration for what he called unfair treatment of Chinese telecom giant Huawei Technolgies Co., raising the ire of some Republican senators.聽

That longstanding relationship has prompted White House adviser Peter Navarro, one of the top administration opponents to the TikTok deal, to argue that Microsoft may not be the best suitor for the unit of China-based ByteDance Ltd., or that Microsoft should perhaps be made to divest its Chinese holdings should it acquire TikTok in the US.聽

鈥淲hose software does the People鈥檚 Liberation Army and China run on? Microsoft,鈥 Mr. Navarro told CNN on Monday. 鈥淭he Chinese Communist Party, whose software do they use to do all the things they do? It鈥檚 Microsoft. So this is not a white hat company. It鈥檚 an American company, it鈥檚 clearly a multinational company, that鈥檚 made billions in China, that enables Chinese censorship through things like Bing and Skype.

鈥淢icrosoft is one of one of four or five American technology companies, Yahoo, Google, Cisco and others, who helped China originally build the Great Firewall of China, which is used to surveil, track, monitor, censor and imprison the Chinese people,鈥 Mr. Navarro said. 鈥淏ut more importantly, one of the few surviving search engines from America in China is Bing and Microsoft owns Bing so we know that there鈥檚 some some fishy stuff going on there.鈥

The Great Firewall of China is the term used to describe the combination of regulation, technology and human monitoring used to control and restrict the internet in the country. Internet products such as Google鈥檚 search engine and Facebook Inc.鈥檚 main social network aren鈥檛 available in China due in part to the reluctance of the US companies to censor information for the Chinese government.

A Microsoft spokesman declined to comment.

Microsoft has emerged as a top contender to buy TikTok partly because Facebook, Alphabet Inc.鈥檚 Google and other tech giants are being scrutinized by US regulators and lawmakers over antitrust issues. Microsoft, which settled antitrust cases almost two decades ago, now occupies an enviable position of relative trust among big tech companies. Rival Slack Technologies Inc. has made a complaint against Microsoft in Europe and may do the same in the US, so that could change.聽

While it has sued the Trump administration several times on issues surrounding cloud data privacy and immigration, Microsoft also has maintained friendly relations, particularly through large contracts with the government. It was recently awarded a massive Defense Department cloud contact over rival Amazon.com Inc., which Amazon is alleging in a lawsuit stemmed from Trump鈥檚 bias against the e-commerce giant, and unlike Google, Microsoft hasn鈥檛 avoiding bidding for military technology deals.聽

Over the weekend, Microsoft Chief Executive Officer Satya Nadella held talks with Trump, which for the time being salvaged Microsoft鈥檚 efforts on TikTok after Trump told reporters Friday night that he planned to ban the app from the US聽

Microsoft has faced challenges with the Beijing government, too, and has struggled to contain software piracy in the country. Its offices were raided in 2014 as part of an anti-monopoly investigation that ran for several years. The Windows operating system had been banned at times from Chinese government computers, leading Microsoft to offer an altered version that allows the government to use its own encryption and removes some apps and features. And while China accounts for about 18% of the world鈥檚 population, it鈥檚 less than 2% of Microsoft鈥檚 sales, partially because the Chinese market isn鈥檛 fully open to US companies, Mr. Smith said at a conference in January.聽

Still, Microsoft鈥檚 approach differs from rival Google, which pulled its search engine from China in 2010 over concerns about censorship and has since scrapped some search and cloud initiatives it was working on for that market. Last year, the company ended a secretive project, called Dragonfly, to build a new search app in China. In May, Google shut down a plan to offer a new cloud service in China and other politically sensitive countries due, in part, to concerns over geopolitical tensions, sources told Bloomberg News last month. Microsoft and Amazon both offer this kind of cloud service, which lets countries keep data stored locally. Still, at a congressional antitrust hearing last week, multiple lawmakers hammered Google for its recent efforts in China, including setting up an AI lab in Beijing.

For a company to successfully acquire TikTok in the US, it will have to pass national security and antitrust muster with Beijing and Washington. Microsoft鈥檚 careful work with both governments may make it one of the few that can thread the needle. At the same time, it鈥檚 bound to arouse suspicion from both sides that it鈥檚 too close to the other. 鈥 Bloomberg