Oracle has triumphed over Microsoft in the fierce contest to run TikTok's operations in the United States, offering it a last-minute reprieve from the wrath of the US government.
Sources told US news outlets that the database giant has been chosen by TikTok's Chinese parent company, ByteDance, as the new custodian of its 100m American users.
It comes just days before the deadline set by President Donald Trump, who had ordered ByteDance to sell TikTok to a US company or be banned from the country.
Mr Trump had previously expressed support for Oracle's bid, lauding its biggest shareholder Larry Ellison, as "a great guy". Mr Ellison is one of Mr Trump's few vocal supporters in the top ranks of Silicon Valley.
The President has accused TikTok of making Americans' private data vulnerable to the Chinese government and of censoring its users in line with Communist Party dogma (TikTok denies both).
The exact structure of the deal is unclear, but reports suggested it will be some form of partnership, rather than an outright acquisition. It will still need to be approved by US officials.
A spokesman for Microsoft said: "ByteDance let us know today they would not be selling TikTok’s US operations to Microsoft. We are confident our proposal would have been good for TikTok’s users, while protecting national security interests.
"To do this, we would have made significant changes to ensure the service met the highest standards for security, privacy, online safety, and combatting disinformation, and we made these principles clear in our August statement.
"We look forward to seeing how the service evolves in these important areas."
ByteDance and Oracle did not immediately respond to requests for comment.
If approved, the deal would save TikTok from oblivion in one of its biggest markets, as well as allowing ByteDance to recoup some of the value of China's first true international app store hit.
Last week China had disrupted the negotiations by imposing new export controls on recommendation algorithms like those that have driven TikTok's rise. It is unknown whether the deal would include those algorithms.