HONG KONG — Google withdrew from China eight years ago to protest the country’s censorship and online hacking. Now, the internet giant is working on a censored search engine for China that will filter websites and search terms that are blacklisted by the Chinese government, according to two people with knowledge of the plans.

Google has teams of engineers working on a search app that restricts content banned by Beijing, said the people, who asked for anonymity because they were not permitted to speak publicly about the project. The company has demonstrated the service to Chinese government officials, they added.

Yet the existence of the project does not mean that Google’s return to China is imminent, the people cautioned. Google often builds and tests different services that never become publicly available.

Google’s reversal in China, which was reported earlier by The Intercept, is the latest example of how American tech companies are trying to tailor their products to enter the huge Chinese market, even if it means tamping down free speech. LinkedIn censors content in China, for example. And Facebook developed software to suppress certain posts from appearing on the social network, with the aim of potentially deploying it in China, though there was no indication it was offered to Chinese authorities.