By Andrew Restuccia, John D. McKinnon and Georgia Wells

WASHINGTON -- President Trump said he has agreed in concept to a deal under which Chinese-owned video-sharing app TikTok will partner with Oracle Corp. and Walmart Inc. to become a U.S.-based company, capping negotiations that have stirred debate over national security and the future of the internet.

"I have given the deal my blessing, if they get it done that's OK too, if they don't that's fine too," Mr. Trump told reporters at the White House on Saturday.

The president said the agreement will result in the creation of 25,000 jobs, mostly in Texas, adding that the new company will still be called TikTok and "will have nothing to do with China."

He added that the Oracle and Walmart are planning to set up a $5 billion fund for the education of young Americans. He did not offer further details.

Under the terms of the deal, Walmart and Oracle would share a 20% stake in a new U.S.-based entity that will operate TikTok, with Oracle likely getting a somewhat larger piece between those two, according to a person familiar with the deal.

It couldn't immediately be learned how the rest of the ownership would be divided.

The negotiations over TikTok's U.S. operations began after the president signed an executive order in August that labeled TikTok a national-security threat, forcing its owner, Beijing-based ByteDance Ltd., to pursue a sale or partnership with a U.S. company.

The administration contends that the data TikTok collects from U.S. users could be shared with the Chinese government. TikTok has said it would never hand over such data.

Oracle beat out several other companies that had expressed interest in TikTok, including Microsoft Corp. and Twitter Inc.

In response to Mr. Trump's August executive order, the Commerce Department on Friday issued regulations barring U.S. companies from providing downloads or updates for TikTok after 11:59 p.m. Sunday. The order also applies to WeChat, another popular Chinese-owned app that isn't part of the deal discussions.

ByteDance has been locked in negotiations over how to address the U.S. government's security concerns and this week seemed to be gaining momentum toward an agreement that could be signed by Mr. Trump.

Mr. Trump told reporters Friday that he expected to make a decision soon on that partnership.

"They're going to be showing me everything in a little while on TikTok," the president told reporters at the White House before departing for a rally in Minnesota. "We're going to make a fairly fast decision. I don't think we have to delay it too much," he added, calling TikTok "a pretty incredible asset."

Friday's move by the Commerce Department first appeared to throw up a new roadblock, but the president's comments were greeted by the deal participants as a positive sign that a resolution is possible soon.

The negotiations already had been working against a Sunday deadline as a result of the August executive order. The Commerce Department's move clarified and defined how the Sunday ban would work if the parties fail to reach an agreement that satisfies the U.S. government.

In a statement, TikTok said its proposal to the U.S. government contained unprecedented levels of transparency and accountability about how it handles user data, and that it disagrees with the Commerce Department's move. The company has filed a lawsuit challenging the August executive order.

"Our community of 100 million U.S. users love TikTok because it's a home for entertainment, self-expression, and connection, and we're committed to protecting their privacy and safety as we continue working to bring joy to families and meaningful careers to those who create on our platform," TikTok said.

TikTok is hugely popular among young people in the U.S., and its fate has been closely watched by its fans as well as Silicon Valley's top executives.

Adam Mosseri, chief executive of Facebook Inc.'s Instagram tweeted on Friday that a U.S. ban of TikTok "would be quite bad for Instagram, Facebook, and the internet more broadly." Instagram earlier this year launched a new service called Reels that includes many features similar to TikTok and was seen as a potential threat to the app's surge in popularity.

Vanessa Pappas, the interim head of TikTok, quickly voiced her agreement with Mr. Mosseri and challenged his company to do more. "We invite Facebook and Instagram to publicly join our challenge and support our litigation. This is a moment to put aside our competition and focus on core principles like freedom of expression and due process of law," she said on Twitter.

The Wall Street Journal previously reported that Facebook CEO Mark Zuckerberg had stoked concerns about TikTok in Washington.

Write to Andrew Restuccia at Andrew.Restuccia@wsj.com, John D. McKinnon at john.mckinnon@wsj.com and Georgia Wells at Georgia.Wells@wsj.com