Donald Trump will take action in coming days to tackle an array of national security risks presented by TikTok and other Chinese software companies, Mike Pompeo has said, as Microsoft revealed it was pursuing a deal after speaking to the US president.

Microsoft said late on Sunday that – after a conversation between Trump and its CEO, Satya Nadella – it would move quickly on acquisition talks with TikTok’s parent company, ByteDance, completing talks no later than 15 September. It pledged to ensure that all private data of American users was transferred to, and remained in, the US.

Two people familiar with the matter told Reuters that Trump had agreed to give ByteDance 45 days to negotiate a sale TikTok to Microsoft.

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

The statement came after Pompeo told Fox News show Sunday Morning Futures: “These Chinese software companies doing business in the United States, whether it’s TikTok or WeChat – there are countless more … are feeding data directly to the Chinese Communist party, their national security apparatus.

“Could be their facial recognition patterns. It could be information about their residence, their phone numbers, their friends, who they’re connected to. Those are the issues that President Trump has made clear we’re going to take care of,” he said.

TikTok’s US user data is stored in the US, with strict controls on employee access, and its biggest investors come from the US, the company said on Sunday. A TikTok spokesperson said: “We are committed to protecting our users’ privacy and safety as we continue working to bring joy to families and meaningful careers to those who create on our platform.”

Trump had said on Friday that he would soon ban TikTok in the US. A federal committee is reviewing whether that is possible. Treasury secretary Steven Mnuchin said its members agreed that TikTok could not remain in the US in its current form, because it “risks sending back information on 100 million Americans”.

“We all agree there has to be a change … everybody agrees it can’t exist as it does,” Mnuchin said Sunday on ABC’s This Week.

Chinese state media said banning Tik Tok would be “a barbaric act of a rogue government”, and rejected the US’s claims about national security fears. A Global Times editorial, published on Sunday, said a Microsoft acquisition was “the hunting and looting of TikTok by the US government in conjunction with US high-tech companies”.

The editorial also suggested any ban was politically motivated because many teens – who are the main users of TikTok – don’t like Trump.

As speculation grew over a ban or sale of the social media’s US business, TikTok posted a video on Saturday saying: “We’re not planning on going anywhere.”

On Monday morning, ByteDance said it would “adhere to the vision of globalisation” despite being “faced with all kinds of complex and unimaginable difficulties”.

TikTok’s catchy videos and ease of use has made it popular, and it says it has tens of millions of users in the US and hundreds of millions globally. Its parent company, ByteDance, launched TikTok in 2017. It bought Musical.ly, a video service popular with teens in the US and Europe, and combined the two. It has a similar service, Douyin, for users in China.

But TikTok’s Chinese ownership has raised concern about the potential for sharing user data with Chinese officials as well as censorship of videos critical of the Chinese government. TikTok says it does not censor videos and it would not give the Chinese government access to US user data.

“The president, when he makes his decision, will make sure that everything we have done drives us as close to zero risk for the American people,” Pompeo said. “That’s the mission set that he laid out for all of us when we began to evaluate this now several months back. We’re closing in on a solution. And I think you will see the president’s announcement shortly.”

The debate over TikTok parallels a broader US security crackdown on Chinese companies, including telecom providers Huawei and ZTE. The Trump administration has ordered that the US stop buying equipment from those providers to be used in US networks. Trump has also tried to steer allies away from Huawei over concerns that the Chinese government has access to its data, which Huawei denies.