“I said, ’Look it can’t be controlled for security reasons by China,’” Mr. Trump said. “Here’s the deal, I don’t mind whether it’s Microsoft or somebody else—a big company, a secure company, a very American company buy it.”

But the president, who on Friday floated banning TikTok, also said there would be conditions to a sale and he did not see how only part of the company could be purchased. Microsoft has said it is interested in buying TikTok operations in the U.S., Canada, New Zealand and Australia, leaving other parts of the business in Chinese ownership.

“I did say that ‘If you buy it…a very substantial portion of that price is going to have to come into the Treasury of the United States, because we’re making it possible for this deal to happen.’ Right now they don’t have any rights unless we give it to them.”