TikTok has said it will quit Hong Kong after China imposed a new security law on the city.

"In light of recent events, we've decided to stop operations of the TikTok app in Hong Kong," a spokesman told the BBC.

The company's exit from the city will come "within days," according to the Reuters news agency.

Facebook and Twitter said this week they were "pausing" co-operation with Hong Kong police over user information.

The short-form video app was launched by China-based ByteDance for users outside mainland China as part of a strategy to grow its global audience. 

The tech company operates a similar short video sharing app in China called Douyin.

TikTok, now run by former Walt Disney executive Kevin Mayer, has said in the past that the app's user data is not stored in China.

The company has also said previously that it would not comply with any Chinese government requests to censor content or give access to its users' data, nor has it ever been asked to do so.

However, the controversial national security law in Hong Kong has given Chinese authorities sweeping new powers, raising concerns about data privacy.

The legislation punishes what China describes broadly as secession, subversion, terrorism and collusion with foreign forces, with up to life in prison.

Critics say it erodes Hong Kong's freedoms as a semi-autonomous region, including freedom of speech.

Facebook, WhatsApp, Twitter, Google and Telegram have all announced this week that they are also making changes to their operations in Hong Kong after the new security law came into force last week.

The tech firms have said they are not processing data requests from the Hong Kong police while they assess the ongoing political changes in the city.

TikTok walks a fine line with Beijing

TikTok's decision to stop operations in Hong Kong of its popular video app looks unusual - but is strategic.

The company has struggled to fight off suspicions that it operates under Chinese law, or under the control of Beijing.

Which is why TikTok has been at pains to try to change its global image - and this move could be one more step towards doing that.

TikTok has also consistently said that if asked, it would never hand over data to Beijing - and that it's never been asked for any user data either.

Staying in Hong Kong, under the new law, may make it difficult for it to keep to that commitment.

Its biggest market is India - where it has recently been banned by the Indian government because of a border conflict with China. Analysts say it could potentially lose up to a billion dollars in lost advertising revenue in India.

Which is why it is keen to show that it is not simply a Chinese-owned firm - but a global company that is also an international and responsible social media player.

'Restoring safety'

On Tuesday, Hong Kong's leader Carrie Lam defended the national security law imposed by Beijing saying it was not "doom and gloom" for the city.

Ms Lam said the law would restore Hong Kong's status as one of the safest cities in the world after pro-democracy protests last year often turned violent.

"Compared with the national security laws of other countries, it is a rather mild law. Its scope is not as broad as that in other countries and even China," she said.

The legislation has been heavily criticised globally for undermining freedoms guaranteed under the "one country, two systems" agreed as part of the former British colony's return to Chinese rule in 1997.

Also on Tuesday US Secretary of State Mike Pompeo told Fox News that the US is "certainly looking at" banning Chinese social media apps, including TikTok.

"I don't want to get out in front of the President (Donald Trump), but it's something we're looking at," Mr Pompeo said. BBC