President Donald Trump says he has approved a deal for TikTok's parent company, ByteDance to partner with Oracle and Walmart. The deal was approved just in time to avoid a shutdown in the United States, as Trump has threatened.

Donald Trump, Tiktok, OracleCindy Ord / Getty Images

“I have given the deal my blessing — if they get it done that’s great, if they don’t that’s okay too,” Trump told reporters at the White House, Saturday. “I approved the deal in concept.”

Oracle will become a minority investor with a 12.5% stake, while Walmart has agreed to purchase a 7.5% stake.

"As part of this proposal, Oracle will become our trusted technology provider, responsible for hosting all US user data and securing associated computer systems to ensure US national security requirements are fully satisfied," TikTok explained in a statement. "We are currently working with Walmart on a commercial partnership as well. Both companies will take part in a TikTok Global pre-IPO financing round in which they can take up to a 20% cumulative stake in the company. We will also maintain and expand TikTok Global's headquarters in the US, while bringing 25,000 jobs across the country."

“In addition, we would work toward an initial public offering of the company in the United States within the next year to bring even more ownership to American citizens,” a Walmart spokesperson said in a statement. 

Trump says the companies will contribute to donate $5 billion to an education fund.

“We’re going to be setting up a very large fund for the education of American youth and that’ll be great,” Trump said. “That’s the contribution I’ve been asking for.”