Director of the US National Security Agency (NSA) General Keith Alexander denied allegations his organisation had infiltrated Yahoo and Google databases, calling the reports “factually incorrect”. He added that it would be illegal for the NSA to break into companies’ databases.

It follows a claim in the Washington Post that the NSA, at the centre of a worldwide diplomatic row over spying, secretly accessed the main communications links that connect Yahoo and Google data centres around the world.

The Post said the NSA and Britain’s GCHQ are copying entire data flows across fibre-optic cables that carry information between the data centres of the Silicon Valley giants. The US paper cited documents obtained from former NSA contractor Edward Snowden.

This is not NSA breaking into any databases. It would be illegal for us to do that. Gen Keith Alexander

“Not to my knowledge, that’s never happened,” said Alexander.

“In fact, there was this allegation last June that NSA was tapping into the servers of Yahoo or Google or our industry reps. That is factually incorrect.

“The servers and everything that we do with those, those companies work with us, they are compelled to work with us. This isn’t something the court just said, ‘would you please work with them and just throw data over it.’ It is compelled and these are specific requirements that come from a court order.

“This is not NSA breaking into any databases. It would be illegal for us to do that and so I don’t know what the report is, but I can tell you factually, we do not have access to Google servers, Yahoo servers, dot, dot, dot. We go through a court order.”

Google’s chief legal officer David Drummond said the company was “outraged” by the latest revelations, the Guardian reported.

“We have long been concerned about the possibility of this kind of snooping, which is why we have continued to extend encryption across more and more Google services and links, especially the links in the slide.”

Millions of records from Yahoo and Google

A secret accounting dated 9 January 2013 indicates that the NSA sends millions of records every day from Yahoo and Google internal networks to data warehouses at the agency’s Fort Meade, Maryland, headquarters.

In the last 30 days, field collectors had processed and sent back more than 180 million new records – ranging from “metadata,” which would indicate who sent or received emails and when, to content such as text, audio and video, according to the Washington Post.

The latest revelations were met with anger from Google, and triggered legal questions regarding US wire tap laws.

Prism is a separate programme which uses a court order to compel Yahoo, Google and other internet companies to provide certain data. It allows the NSA to reach into the companies’ data streams and grab emails, video chats, pictures and more.

US officials have said the programme is focused on national security – with mainly foreign targets. Technology companies say they turn over information only if required by court order.