(Bloomberg) — Oracle Corp. edged out rival Microsoft Corp. in negotiations for the U.S. operations of TikTok, people familiar with the talks said, as the Chinese-owned music-video app attempts to avoid getting shut down in a clash between the world’s two superpowers.A deal between TikTok owner ByteDance Ltd. and Oracle will look more like a corporate restructuring than the outright sale Microsoft had proposed, though it is likely to include a stake in a newly configured American business, said one of the people, who asked not to be identified because the information isn’t public.The terms being discussed with Oracle are still evolving, one of the people said. One of the options being explored is that Oracle could take a stake in a newly formed U.S. business while serving as TikTok’s U.S. technology partner and housing the video app’s data in Oracle’s cloud servers. Early offers from both parties valued the U.S. business at about $25 billion, but that was before Chinese officials weighed in with new rules imposing limits on technology exports, said people with knowledge of the matter.Oracle’s shares traded as much as 17% higher in early trading before markets opened in New York on Monday, after closing at $57 on Friday.The sale of TikTok — forced by a Trump administration ban on grounds of national security — is one of the issues at the heart of the fraying Washington-Beijing relationship. Any deal still requires signoffs from both sides. Microsoft, which was working with Walmart Inc., had been seen as the likely winner but talks cooled in recent days, one person said. Microsoft wasn’t asked to make revisions to its initial offer in the face of recent signs of opposition to a deal from Chinese government officials, the person added.It’s unclear whether a deal with Oracle would pass muster with the Trump administration, according to a person familiar with the discussions. But couching the deal as a corporate overhaul may help in Beijing. It could allay fears about TikTok’s cache of sensitive U.S. data while addressing Chinese concerns over the export of key artificial-intelligence technology, said Yik Chan Chin, who researches global media and communications policy at the Xi’an Jiaotong-Liverpool University in Suzhou.“If you say this is a hostile takeover, that may not be nice for both parties,” she said. “But if you frame it as like a restructuring or spinoff,” that’s more acceptable to the two governments.China’s government on Monday declined to comment on the prospect of a ByteDance-Oracle tie-up.“China has talked about its position on TikTok many times. The U.S. is now encircling TikTok. This is a typical coerced transaction by the government,” Foreign Ministry spokesman Wang Wenbin said at a briefing in Beijing.ByteDance intends to bring a proposal to the White House ahead of a mid-September deadline imposed by Trump, a person with knowledge of the matter said. The progress in the talks with Oracle ignited celebrations among TikTok’s mostly young devotees.“TikTok sold, you guys, that means we’re not going anywhere,” declared @ElianaGhen, who has 2.4 million followers, in a video touting the Oracle deal. “Best birthday gift ever, TikTok is here to stay!” said @mrsscott_teaches, who has 22,000 followers.The app, which lets people record and edit short video clips ranging from lighthearted lip-syncs to more serious political statements, gained popularity during the global pandemic that’s kept many people cooped up indoors. TikTok’s loyal following of more than 100 million in the U.S. helps explain the strong interest among early suitors, from Microsoft to private equity giants such as Sequoia and General Atlantic.Walmart remains interested in making a TikTok investment alongside a consortium of investors led by Oracle. A spokesperson for the retailer said Sunday it “continues discussions with ByteDance leadership and other interested parties. We know that any approved deal must satisfy all regulatory and national security concerns.”Talk of a corporate restructuring harks back to ByteDance’s original intentions earlier in the summer to sell a partial stake in TikTok’s operations, or restructure the company with a global headquarters and board of directors outside of China. Those aspirations were complicated by Trump’s threats to ban the app and subsequent executive orders, which prohibit U.S. people and businesses from doing business with TikTok.If the Chinese company is able to get a deal through the White House that doesn’t involve an outright, forced sale, it would be a major feat for ByteDance founder Zhang Yiming, who has been reluctant to hand over such a prized asset. Yet critics were still questioning how a technology partnership with Oracle, rather than an outright sale, would assuage the White House’s national security concerns.“A deal where Oracle takes over hosting without source code and significant operational changes would not address any of the legitimate concerns about TikTok, and the White House accepting such a deal would demonstrate that this exercise was pure grift,” Alex Stamos, former chief security officer at Facebook, said in a post on Twitter.Read more: China Throws a Wrench Into Trump’s Plan to Force TikTok SaleBeijing’s stance is another big question mark. Shortly after bids from Microsoft and Oracle were submitted, the Chinese government announced its right to be closely involved in approval of any deal as well as its opposition to exporting key algorithms, such as a recommendation engine that underpins TikTok. ByteDance appeared eager for a more limited sort of agreement than Microsoft wanted, where it would retain more control, one of the people familiar with the negotiations said.Some U.S. officials would prefer shutting down TikTok’s U.S. operations if a sale doesn’t meet their demands for putting the business and related data into American hands.“ByteDance let us know today they would not be selling TikTok’s U.S. operations to Microsoft,” Redmond, Washington-based Microsoft said in a statement on Sunday. “We are confident our proposal would have been good for TikTok’s users, while protecting national security interests.”Microsoft representatives declined to comment beyond the statement. Representatives for TikTok declined to comment, and Oracle didn’t respond to requests for comment outside normal business hours. The White House also didn’t immediately respond to a request for comment.Microsoft was the early front-runner for the acquisition, having started talks with ByteDance weeks before Trump’s executive orders and believing it had the preliminary framework of a deal the U.S. government could back.Read more: Oracle’s Improbable TikTok Talks Have a Simple Explanation: DataThen Oracle, a company with a closer relationship to the U.S. president, emerged as a bidder with the backing of Sequoia Capital, a key ByteDance shareholder.For the corporate software giant, TikTok is a less obvious fit, but may make sense in light of the company’s desire to build up its cloud-computing and consumer-data businesses. Oracle creates profiles of ordinary people and sells them to companies looking to reach specific audiences.TikTok stores massive amounts of data and is a large customer of cloud services run by Amazon Web Services and Alphabet Inc.’s Google. A partnership with TikTok also resonates with Oracle Chairman Larry Ellison’s cheerleading for American tech interests.Oracle has nurtured a relationship with Trump since before his administration began. In 2016, Chief Executive Officer Safra Catz served on the president’s transition team, and two years later, dined with him at the White House, where she complained about a government contract she deemed unfair, Bloomberg reported.Vice President Mike Pence visited Oracle’s headquarters in Redwood City, California. Catz has contributed more than $125,000 this year to support Trump’s re-election, according to Federal Election Commission data. And Ellison let Trump use one of his California estates to hold a fund-raiser in February.In recent weeks, the U.S. president had publicly endorsed the Oracle bid and called Ellison a “tremendous guy.” Trump economic adviser Peter Navarro, who earlier came out against a potential sale to Microsoft and had at one time advocated banning TikTok completely, echoed that endorsement during an August appearance on Fox News.“If you look at Microsoft versus Oracle, the one thing that separates the two companies with respect to national security is that Microsoft has a large footprint in China,” Navarro said. “Oracle on the other hand has a strong reputation of really putting a great firewall between its operations and China and that’s an important thing.”(Updates with pre-market share price move in fourth paragraph.)For more articles like this, please visit us at bloomberg.comSubscribe now to stay ahead with the most trusted business news source.©2020 Bloomberg L.P.