Apple CEO Tim Cook delivers the keynote address during a special event on September 10, 2019 in the Steve Jobs Theater on Apple's Cupertino, California campus.

Apple on Wednesday removed an app that protesters in Hong Kong have used to track police movements from its app store, saying it violated rules because it was used to ambush police.

The U.S. tech giant had come under fire from China over the app, with the Chinese Communist Party's official newspaper calling the app "poisonous" and decrying what it said was Apple's complicity in helping the Hong Kong protesters.

Apple rejected the crowdsourcing app, HKmap.live, earlier this month but then reversed course last week.

Apple said in a statement that it had began an immediate investigation after "many concerned customers in Hong Kong" contacted the company about the app and Apple found it had endangered law enforcement and residents.

"The app displays police locations and we have verified with the Hong Kong Cybersecurity and Technology Crime Bureau that the app has been used to target and ambush police, threaten public safety, and criminals have used it to victimize residents in areas where they know there is no law enforcement," the statement said.

Apple did not comment beyond its statement, and the app's developer did not immediately have a comment on the removal.

Hong Kong police had no immediate comment.