Walmart’s entry into the mix surprised even many people close to the talks. The world’s biggest retailer by revenue has been ramping up its online business.

Photo: Jim Thompson/Albuquerque Journal/Zuma Press

The race to capture TikTok’s U.S. operations took a sharp turn on Thursday, as retail giant Walmart Inc. WMT 4.54% said it is joining Microsoft Corp. MSFT 2.46% ’s bid for the popular video-sharing app after other deep-pocketed suitors dropped out of the running.

Walmart’s entry into the global sweepstakes was a surprise, and comes as the parties grapple with a valuation for TikTok, which is facing a potential ban in the U.S. from the Trump administration over national-security concerns.

TikTok’s Beijing-based owner ByteDance Ltd. is asking about $30 billion for the U.S. operations, but bidders thus far haven’t been willing to meet that price, according to people familiar with the negotiations. By comparison, Twitter Inc. in recent weeks informally floated a bid closer to $10 billion as a part of a range of pricing and scenarios, said some of the people.

Microsoft’s joint bid with Walmart is considered the front-runner, according to people familiar with the matter, while a second consortium including Oracle Corp. also remains in the running.