The iPhone maker has removed an app that allowed rioters in Hong Kong to track where police are located after reports that it was used to ambush officers and vandalize communities where law enforcement was not present.

Following other companies that have taken sides in the ongoing unrest in China’s autonomous city, Apple allowed HKmap.live to appear in its app store. But the ‘noble’ goal of helping the rioters praised in the Western media brought unintended consequences.

"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 company said in a statement.

Also on rt.com Why is Apple 'guiding Hong Kong thugs'? US corporations face choice between virtue-signaling and business

The move to remove the app also came after a rebuke from Beijing. On Wednesday, the Chinese People’s Daily published an op-ed titled “Is Apple guiding Hong Kong thugs?” It warned that the map app “facilitates illegal behavior” and that Apple is hurting its reputation among Chinese consumers by “mixing business with politics and commercial activity with illegal activities.”

Apple manufactures most of its products in China, which is the second-largest market for Apple products.

Initially the company rejected the app – which displays not only police movements, but also whether tear gas has been used in particular areas, among other protester-specific features – but decided to reconsider the move after an appeal. The demonstrations that started over a now-shelved extradition bill in March have turned into weekly riots with radical groups of protesters vandalizing property, beating people for supporting Beijing, and attacking police.

Also on rt.com WATCH Hong Kong protesters beat & set fire to ‘off-duty cop’

While rejecting the government’s invitation for negotiations, the protesters became darlings of the Western media, which describes them as ‘pro-democracy’. They have enjoyed the open support of US and European politicians and celebrities despite repeated calls from Beijing not to interfere in its internal affairs. American companies soon followed suit.

Both American shoe company Vans and the NBA have also become embroiled in Hong Kong’s unrest, with Vans drawing the ire of protesters after scrapping a shoe design favorable to the demonstrations. Some in the city are now calling for a boycott of the company. As for the NBA, its trouble began with a single tweet from Houston Rockets General Manager Daryl Morey, who voiced support for the protesters. The tweet has since blown up into a conflict between the basketball league and Beijing, which has stopped airing games on its largest state broadcaster.

Companies like Apple are no stranger to political controversy, especially in the Trump era, when seemingly every corporation must signal their virtue on a range of touchy issues, from transgender-friendly pronouns, to any protests that erupt anywhere on Earth. However, even with Beijing half a world away from Cupertino, California, Apple may find that alienating a customer base of 1.4 billion people is not a good idea.

Think your friends would be interested? Share this story!