The Trump administration has accused TikTok and others of providing data to the Chinese government, which Beijing and TikTok deny.
“The United States should get a very large percentage of that price, because we’re making it possible,” Mr Trump said.
“It would come from the sale, which nobody else would be thinking about but me, but that’s the way I think, and I think it’s very fair,” he added.
The request for payment to the US Treasury further complicated negotiations as legal experts highlighted that such a demand to secure regulatory approval for a takeover deal would be highly unorthodox.
Nicholas Klein, a lawyer at DLA Piper, said generally “the government doesn’t have the authority to take a cut of a private deal through” the Committee on Foreign Investment in the United States, which is the inter-agency committee that reviews some foreign investments in the US.
The state-run China Daily newspaper said on Tuesday that Beijing would not accept the “theft” of a Chinese technology company.
It also warned in an editorial that China had “plenty of ways to respond if the administration carries out its planned smash and grab”.
Charlotte Jee, a reporter at MIT Technology Review, a magazine owned by Massachusetts Institute of Technology, said Mr Trump’s comments were “pretty astonishing”.
Speaking to the BBC’s Today programme, she said: “I hate to say this but it is kind of almost Mafia-like behaviour – threatening a ban which pushes down the price then saying ‘oh we should get a cut of that deal afterwards to say thank you for what we’ve done there’.
Talks over a potential deal looked to have been derailed on Friday when Mr Trump said he opposed Microsoft buying TikTok’s US business.
While Mr Trump now giving his approval to a possible takeover is a major shift in the White House’s position, the tight deadline for talks is another major hurdle for any potential deal.
By Dearbail Jordan, business correspondent
Former FBI director James Comey once said that dealing with Donald Trump gave him “flashbacks to my earlier career as a prosecutor against the Mob”.
The US president has certainly made TikTok an offer it can’t refuse.
If the video app doesn’t break away from its Chinese owner, ByteDance, and sell its US operation to Microsoft, Mr Trump will simply ban it – putting TikTok’s access to its 80 million active American users in jeopardy.
Mr Trump has already flexed his muscles against other Chinese firms, such as Huawei.
But what makes the situation with TikTok unprecedented is the demand for a cut of the sale price. The US Treasury has not explained how this extraordinary demand for a cut of a private transaction would work.
Mr Trump reckons the government should get a big slice of the pie because “we’re making it possible”.
However, the deal wouldn’t be happening in the first place but for his administration’s claim that the likes of TikTok are feeding users’ data directly to the Chinese Communist Party.
Perhaps Mr Trump is just doing outwardly what some governments have been doing for years.
But one thing is certain, Mr Trump’s demand for payment has muddied the waters in an already fraught situation.
TikTok’s US operations “will close down on September 15 unless Microsoft or somebody else is able to buy it and work out a deal, an appropriate deal so the Treasury… of the United States gets a lot of money,” he said.
As well as TikTok’s US business, Microsoft is also in talks to buy its operations in Canada, Australia, and New Zealand – countries that make up four of the Five Eyes intelligence alliance.
The UK is also a member of the alliance and there has been speculation that TikTok could base its global headquarters in London, joining tech giants such as Google which has a major presence in the capital.
ByteDance said: “ByteDance is committed to being a global company. In light of the current situation, ByteDance has been evaluating the possibility of establishing TikTok’s headquarters outside of the US, to better serve our global users.”
White House trade adviser Peter Navarro suggested that Microsoft could shed its holdings in China if it buys TikTok’s US business.
“So the question is, is Microsoft going to be compromised?” Mr Navarro said in an interview with CNN. “Maybe Microsoft could divest its Chinese holdings?”