(Bloomberg) -- Microsoft Corp.’s attempt to buy TikTok’s U.S. operations represents the latest step in a careful dance the software maker has performed to meet the demands of the Chinese and U.S. 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 U.S. But the company also wants to maintain its robust business in China, the world’s most-populous country.

Microsoft entered China in 1992, helping to engineer the government's computer systems and installing special versions of Windows operating systems that would comply with the country's 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's 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 U.S. 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 U.S. 

"Whose software does the People’s Liberation Army and China run on? Microsoft,” Navarro told CNN on Monday. “The Chinese Communist Party, whose software do they use to do all the things they do? It's Microsoft. So this is not a white hat company. It's an American company, it's clearly a multinational company, that's made billions in China, that enables Chinese censorship through things like Bing and Skype.

"Microsoft 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,” Navarro said. “But more importantly, one of the few surviving search engines from America in China is Bing and Microsoft owns Bing so we know that there's 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’s search engine and Facebook Inc.’s main social network aren’t available in China due in part to the reluctance of the U.S. 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.’s Google and other tech giants are being scrutinized by U.S. 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 U.S., 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’s bias against the e-commerce giant, and unlike Google, Microsoft hasn’t 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's efforts on TikTok after Trump told reporters Friday night that he planned to ban the app from the U.S. 

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’s population, it’s less than 2% of Microsoft’s sales, partially because the Chinese market isn’t fully open to U.S. companies, Smith said at a conference in January. 

Read More: The Great Firewall of China

Still, Microsoft's 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 U.S., it will have to pass national security and antitrust muster with Beijing and Washington. Microsoft’s careful work with both governments may make it one of the few that can thread the needle. At the same time, it’s bound to arouse suspicion from both sides that it’s too close to the other. 

©2020 Bloomberg L.P.