Image copyright AFP Image caption The New York Times said the operation to infiltrate Huawei was codenamed "Shotgiant"

China has demanded a clear explanation from the United States following reports that it infiltrated the servers of the Chinese telecoms giant, Huawei.

The company said it would condemn the invasion of its networks if the reports in the New York Times were true.

The newspaper quoted documents, allegedly from the US National Security Agency (NSA), released by the former contractor, Edward Snowden.

They said the NSA had spied on Huawei and had information on its customers.

The NSA has made no mention of the reports but said it focused only on what it called valid foreign intelligence targets.

It said it did not use intelligence to steal the secrets of foreign companies to help US businesses.

Chinese foreign ministry spokesman, Hong Lei, said China was extremely concerned about the allegations.

"China has already lodged many complaints with the United States about reports of its espionage activities," he said demanding that Washington cease its activities and explain itself.

The New York Times said one of the goals of the US operation was to find out whether Huawei had connections with the People's Liberation Army.

It said the operation, codenamed "Shotgiant", also sought to conduct espionage through the systems and telephone networks that Huawei sold to other countries.

The newspaper said that the NSA had gained access to Huawei headquarters in the southern Chinese city of Shenzhen and found information on the internal workings of its switches and routers.

The German magazine, Der Spiegel, also citing what it said were NSA documents from Edward Snowden, said the US was positioned to launch cyber offensive operations against the Chinese leadership through its access to Huawei networks.

Washington has long seen Huawei as a potential security threat and has blocked some business deals in the US for fear that it would open the door to Chinese military hackers.

Edward Snowden fled to Hong Kong last year and has since been granted asylum in Russia.

He continues to release information that claims to reveal the global activities of the NSA.