United States President Donald Trump has agreed to give China’s ByteDance 45 days to negotiate a sale of popular short-video app TikTok to Microsoft Corp, two people familiar with the matter told the Reuters News Agency.

US officials have said TikTok under its Chinese parent poses a national risk because of the personal data it handles. Trump said on Friday that he was planning to ban TikTok in the US after dismissing the idea of a sale to Microsoft.

But following a discussion between Trump and Microsoft CEO Satya Nadella, the Redwood, Washington-based company said in a statement on Sunday that it would continue negotiations to acquire TikTok from ByteDance, and that it aimed to reach a deal by September 15.

It was not immediately clear what changed Trump’s mind. Banning TikTok would alienate many of its young users before the US presidential election in November, and would likely trigger a wave of legal challenges. Several prominent Republican legislators issued statements in the last two days urging Trump to back a sale of TikTok to Microsoft.

“A win-win in the making,” Republican Senator Lindsey Graham tweeted in response to Trump’s new stance on Sunday.

The negotiations between ByteDance and Microsoft will be overseen by the Committee on Foreign Investment in the United States (CFIUS), a US government panel that has the right to block any agreement, according to the sources, who requested anonymity in advance of a White House announcement. Microsoft cautioned in its statement that there is no certainty a deal will be reached.

“Microsoft fully appreciates the importance of addressing the President’s concerns. It is committed to acquiring TikTok subject to a complete security review and providing proper economic benefits to the United States, including the United States Treasury,” Microsoft said in a statement.

ByteDance and the White House did not immediately respond to requests for comment.

As relations between the United States and China deteriorate over trade, Hong Kong’s autonomy, cybersecurity and the spread of the novel coronavirus, TikTok has emerged as a flashpoint in the dispute between the world’s two largest economies.

Microsoft, which also owns professional social media network LinkedIn, would become a major competitor to social media giants such as Facebook Inc and Snap Inc were its bid for TikTok to succeed.

Under the proposed deal, Microsoft said it would take over TikTok’s operations in the US, Canada, Australia and New Zealand. It said it would ensure that all private data of TikTok’s American users are transferred to and remains in the US.

TikTok has become immensely popular with younger audiences, but the Chinese-owned app has also turned into another flashpoint in the US-China dispute [File: Shiho Fukada/Bloomberg]

Microsoft may invite other US investors to acquire minority stakes in TikTok, the company added. About 70 percent of the outside capital ByteDance has raised came from the US.

It is not clear how much Microsoft could pay for TikTok. Reuters reported last week that ByteDance’s valuation expectations for the app exceeded $50bn, although US pressure to divest it could lower that price tag.

A key issue in the negotiations will be separating TikTok’s technology from ByteDance’s infrastructure and access, to alleviate US concerns about the integrity of personal data. ByteDance owns a Chinese short video app called Douyin that was based on the same code used for TikTok.

One idea under consideration is to give Microsoft and ByteDance a transition period to develop technology for TikTok that will be completely separate from ByteDance, one of the sources said.