Apple yanked an app from its Chinese app store after the country accused the tech giant of giving pro-democracy protesters in Hong Kong a tool to track and “ambush” police.

The iPhone maker said it’s deleting HKmap.live — just days after approving it for the App Store — because it found the app 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,” Apple said.

The move drew criticism, however, for coming a day after the Communist Party-run People’s Daily newspaper excoriated Apple for being “an accomplice to the rioters.”

“Apple Sells Out Pro-Democracy Protesters in Hong Kong to Appease Chinese Government,” tech blog Gizmodo wrote as Twitter users called to #boycottApple.

US Sen. Josh Hawley (R-Mo.) also blasted the move, saying “Apple assured me last week that their initial decision to ban this app was a mistake. Looks like the Chinese censors have had a word with them since. Who is really running Apple? Tim Cook or Beijing?”

Supporters of the app, including Hawley, say HKmap is designed for users to track protests and the police activity that comes with them. They also argue that other popular apps, like driving app Waze, let users track police activity.

China is a vital market for Apple, representing more than 20% of its iPhone demand and 90% of manufacturing, according to Wedbush analyst Dan Ives.

“The last thing they want to do is put themselves into this firestorm,” Ives said. “At the end of the day, China is the heart and lungs of Apple’s success over the coming years. And the last thing they want to do is something that is going to upset the apple cart.”

In a separate move, Apple also removed the Quartz news app from its App Store in China because Chinese authorities said the app violated local laws — resulting in accusations of censorship.

“We abhor this kind of government censorship of the internet, and have great coverage of how to get around such bans around the world,” Quartz Chief Executive Zach Seward told The Verge in a statement.

Google also removed a game from its Chinese Google Play store that allowed users to play as a Hong Kong protester. The search giant said that “The Revolution of Our Times” violated its content rules because it depicted “sensitive events.”

Apple did not comment beyond its statement. The company also removed BackupHK, a separate app that served as a mirror of the HKmap.live app.

On Twitter, an account believed to be owned by the HKmap.live app’s developer said there is no evidence to support the Hong Kong police’s claims via Apple that the app had been used in ambushes.

“We disagree @Apple and @hkpoliceforce‘s claim that HKmap App endanger law enforcement and residents in Hong Kong,” the @hkmaplive account said.