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/Zuma Press

Walmart Inc. WMT 4.74% said it is joining Microsoft Corp. MSFT 3.00% ’s pursuit of TikTok’s U.S. operations, throwing a curveball into the chase for the popular short video-sharing app.

The Trump administration has pushed TikTok’s owner, Chinese technology giant ByteDance Ltd., to sell its American operations after targeting the app over national-security concerns.

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

Google parent Alphabet Inc. was also involved in talks as recently as earlier this week, according to people familiar with the matter. Those talks are now dead. Another bid involving Twitter Inc. has also lost momentum, according to some of the people.