The NSA has been conducting a sophisticated years-long operation against Chinese tech company Huawei, including hacking into its networks, and spying on the companies' top executives, according to reports based on documents leaked by Edward Snowden.

The spy agency launched operation "Shotgiant" in 2007, hacking into Huawei's main servers in Shenzhen, according to The New York Times and German news magazine Der Spiegel.

See also: How TED Got Edward Snowden and the NSA Deputy Director Onstage

The operation had multiple goals. First, infiltrate a company that is the world's third-largest smartphone maker, and has become a major player in the global-networking market. Huawei makes both routers and other hardware that constitute the backbone of the Internet, as well as fiber-optic cables that connect Asia and Africa.

The NSA's elite hacker team, the Tailored Access Operations unit, was able to plant backdoors — best described as hidden vulnerabilities — into Huawei's nework, and even steal its source code. This was part of a plan by the spy agency to monitor computers and networks equipped with Huawei's hardware, which are now used by "high priority targets — Iran, Afghanistan, Pakistan, Kenya, Cuba," according to a document quoted by The Times

The NSA was worried that an increasing amount of Internet communications now go through Huawei's products or fiber-optic cables, something seen as a "unique" threat against the agency's mission to conduct Internet surveillance, according to Der Spiegel.

"Many of our targets communicate over Huawei produced products, we want to make sure that we know how to exploit these products," the NSA document said, according to The Times and Der Spiegel.

The operation's second goal was to monitor the communications of Huawei's leaders to determine whether the company has any connection to the People's Liberation Army. This effort was reportedly very successful, giving the NSA access to many Huawei employees' email communications.

"We currently have good access and so much data that we don't know what to do with it," an internal document said, according to Der Spiegel.

However, the documents don't reveal whether the NSA was able to establish the connection between Huawei and the PLA.

The United States government previously alleged that Huawei has deep ties with the Chinese government. Because of that, both White House officials and the U.S. Congress, have warned that the company cannot be trusted, arguing that China has backdoors that could potentially allow it to spy on Huawei's customers. The company has denied these accusations.

U.S. officials have long drawn a line between American intelligence operations and Chinese hacking campaigns, maintaining that China goes after trade secrets in economic espionage operations that aim to give its companies competitive advantages.

For Adam Segal, a fellow at the Council on Foreign Relations and expert on cybersecurity and China, the new NSA revelations will blur that distinction.

"This is going to be another nail in that coffin, where people say we don't see the distinction, we don't see the difference," he told Mashable.

In a statement, Huawei North America vice-president William Plummer criticized the NSA operations against his company.

"If it is true, the irony is that exactly what they are doing to us is what they have always charged that the Chinese are doing through us," Plummer said, according to The Times. "If such espionage has been truly conducted, then it is known that the company is independent and has no unusual ties to any government and that knowledge should be relayed publicly to put an end to an era of mis- and disinformation."

But Caitlin Hayden, a White House spokesperson, said the U.S. government's "intelligence activities are focused on the national security needs of our country," according to Der Spiegel. "We do not give intelligence we collect to U.S. companies to enhance their international competitiveness or increase their bottom line."

Segal partially agrees with Hayden, saying that even though he thinks the U.S. probably does conduct espionage against foreign targets for economic reasons, that doesn't feed into "American industrial competitiveness, but that distinction is pretty nuanced."