Google withdrew its search engine from China eight years ago due to censorship and hacking but it is now working on a project for the country codenamed "Dragonfly", the employee said on condition of anonymity.

The search project -- which works like a filter that sorts out certain topics -- can be tested within the company's internal networks, the source said.

The news has caused anxiety within the company since it first emerged in U.S. media reports on Wednesday, the employee said.

The tech giant had already come under fire this year from thousands of employees who signed a petition against a $10-million contract with the U.S. military, which was not renewed.

"There's a lot of angst internally. Some people are very mad we're doing it," the source said.

A Google spokesman declined to confirm or deny the existence of the project.

"We provide a number of mobile apps in China, such as Google Translate and Files Go, help Chinese developers, and have made significant investments in Chinese companies like JD.com," spokesman Taj Meadows told AFP.

"But we don't comment on speculation about future plans."

News website The Intercept first reported the story, saying the search app was being tailored for the Google-backed Android operating system for mobile devices.

Terms about human rights, democracy, religion and peaceful protests would be blacklisted, according to The Intercept. The app will automatically identify and filter websites blocked by China's Great Firewall, the news outlet said.

The New York Times, citing two people with knowledge of the plans, said that while the company has demonstrated the service to Chinese government officials, the existence of the project did not mean that Google's return to China was imminent.

Amnesty International urged Google to "change course".

"It will be a dark day for internet freedom if Google has acquiesced to China's extreme censorship rules to gain market access," Patrick Poon, a China researcher for Amnesty, .

"In putting profits before human rights, Google would be setting a chilling precedent and handing the Chinese government a victory."

US internet titans have long struggled with doing business in China, home of a "Great Firewall" that blocks politically sensitive content, such as the 1989 Tiananmen massacre.

Twitter, Facebook and The New York Times website are blocked in China.

In early 2010, Google shut down its search engine in mainland China after rows over censorship and hacking.

Google had cried foul over what it said were cyberattacks aimed at its source code and the Gmail accounts of Chinese human rights activists.

But the company still employs 700 people in China working on other projects.

In December, Google announced it would open a new artificial intelligence research centre in Beijing. Earlier last year, Chinese internet regulators authorised the Google Translate app for smartphones.

The search engine project comes amid a US-China trade war, with both sides imposing tit-for-tat tariffs and President Donald Trump accusing Beijing of stealing US technological know-how.