SAN FRANCISCO — Apple removed an app late Wednesday that enabled protesters in Hong Kong to track the police, a day after facing intense criticism from Chinese state media for it, plunging the technology giant deeper into the complicated politics of a country that is fundamental to its business.

Apple said it was withdrawing the app, HKmap.live, from its App Store just days after approving it because the authorities in Hong Kong said protesters were using it to attack the police in the semiautonomous city.

A day earlier, People’s Daily, the flagship newspaper of the Chinese Communist Party, published an editorial accusing Apple of aiding “rioters” in Hong Kong. “Letting poisonous software have its way is a betrayal of the Chinese people’s feelings,” said the article, which was written under a pseudonym that translates into “Calming the Waves.”

Timothy D. Cook, Apple’s chief executive, said in an email to employees on Thursday that the company had removed the app after receiving “credible information” from the authorities and people in Hong Kong “that the app was being used maliciously to target individual officers for violence and to victimize individuals and property where no police are present.” As a result, he said, the app violated Apple rules and local laws.