WASHINGTON, Aug. 2 (Reuters) - 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 said on Sunday.

U.S. officials have said TikTok under its Chinese parent poses a national risk because of the personal data it handles. Trump said on Friday he was planning to ban TikTok in the United States 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 Sept. 15.

It was not immediately clear what changed Trump’s mind. Banning TikTok would alienate many of its young users ahead of the U.S. presidential election in November, and would likely trigger a wave of legal challenges. Several prominent Republican lawmakers put out 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 U.S. government panel that has the right to block any agreement, according to the sources, who requested anonymity ahead 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, cyber security 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 United States, Canada, Australia and New Zealand. It said it would ensure that all private data of TikTok’s American users is transferred to and remains in the United States.

Microsoft may invite other American investors to acquire minority stakes in TikTok, the company added. About 70% of the outside capital ByteDance has raised has come from the United States.

It is not clear how much Microsoft could pay for TikTok. Reuters reported last week that ByteDance’s valuation expectations for the app exceeded $50 billion, although U.S. 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 U.S. 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.