Just months after being appointed chief executive of TikTok's U.S. operations Kevin Mayer has decided to exit the company.

U.S. President Donald Trump has issued an ultimatum for TikTok to find an American buyer or risk being booted out of the country.

In an internal memo sent by Mayer to TikTok employees he said the change in the "political environment" was the main cause of his decision to leave. Mayer said his decision had nothing to do with the company and its employees and he continued to be impressed with the team behind the popular short-video streaming mobile app.

Mayer said it was with a "heavy heart" he had to leave. Mayer joined as CEO of TikTok and the chief operating officer of its parent company ByteDance Ltd. on June 1. Before his appointment Mayer was the chairman of the direct-to-customer and international division at The Walt Disney Co. TikTok's general manager Vanessa Pappas will be taking over on an interim basis.

As trade tensions between China and the U.S. escalate the administration of President Donald Trump is proceeding with a campaign to purge the country of China's influence. Trump and several officials have accused TikTok of being a national security threat because of its parent company's alleged ties with the government of China. TikTok has repeatedly denied all the accusations saying that it operates independently. TikTok said none of its servers were located in China - therefore it isn't within the jurisdiction of China's government.

Earlier in August Trump signed an executive forcing TikTok to find an American buyer before Sept. 15. If TikTok fails to do so it could be banned from the country. TikTok reportedly held negotiations with a number of American companies including Microsoft, Twitter and Oracle.  

On Monday, TikTok filed a lawsuit against the U.S. government claiming the executive order depreprived it of due process. If the suit is successful it could delay the effect of the executive order. This would give TikTok time to find other offers for acquisition.