US President Donald Trump on Saturday said he had approved a deal allowing Silicon Valley giant Oracle to become the data partner for TikTok to avert a shutdown of the massively popular Chinese-owned video app that Washington has called a security risk.

The deal, announced by the companies, also includes Walmart as a commercial partner and would create a new US company named TikTok Global.

“I think it’s going to be a fantastic deal. I have given the deal my blessing. If they get it done that’s great. If they don’t that’s okay too,” Trump said.

Shortly after, TikTok – owned by China’s ByteDance – confirmed the agreement, which came with companies racing against a Sunday deadline set by Trump’s administration after which new downloads of the app would be banned.

Oracle could buy a 12.5 per cent stake in TikTok before a future initial public offering (IPO), and Walmart a 7.5 per cent stake.

A source close to the matter said ByteDance would keep the rest of the shares. But since the Chinese company is 40 per cent owned by US investors, TikTok would eventually be majority US-owned.

A TikTok spokeswoman said: “We are pleased that the proposal by TikTok, Oracle, and Walmart will resolve the security concerns of the US Administration and settle questions around TikTok’s future in the US.”

ByteDance also confirmed the deal on social media, saying the three companies would reach an agreement that was “in line with US and Chinese law” as soon as possible.

If it comes to fruition, the deal could mark the de-escalation of a technology battle between Washington and Beijing.

It could also allow US citizens to continue using the wildly popular app – the US Department of Commerce announced it was postponing the ban on TikTok downloads until September 27, citing “recent positive developments”.

Trump has claimed for weeks that TikTok is collecting user data for Beijing, without ever providing evidence for his allegations.

Early last month, he gave ByteDance until September 20 to hand over TikTok’s US operations to a US company.

And on Friday, the Trump administration ordered a ban on downloads of the video-sharing app, as well as Chinese-owned messaging platform WeChat.

TikTok’s brand of short, quirky phone videos has become a global phenomenon, especially among young people, with 100 million users in the US alone.

Trump said the “security will be 100 per cent” and that the companies would use separate cloud servers.

He said the deal will lead to the creation of a new company, headquartered in Texas, that will have “nothing to do with China” but will still be called TikTok.

Oracle will be in charge of hosting all US user data and the security of the associated computer systems, while Walmart will supply its online sales, order management and payment services.

In a joint statement, Oracle and Walmart said TikTok Global would “pay more than five billion in new tax dollars to the US Treasury”, while they and the other companies involved in the deal would launch an initiative to develop online education.

Trump, who previously said the federal government deserved a cut of the deal for authorising it, had initially announced the companies would make a “contribution” towards education.