GCHQ also made use of the NSA's extensive database, in search of "untargeted and unwarranted" communications of UK residents, it was alleged.

A memo from the organisation claims the program can collect "pretty much everything it can", alongside details of how GCHQ is able to search the database, with certain restrictions.

In the statement, the NSA spokeswoman said: "Dishfire is a system that processes and stores lawfully collected SMS data. Because some SMS data of US persons may at times be incidentally collected in NSA's lawful foreign intelligence mission, privacy protections for US persons exist across the entire process concerning the use, handling, retention, and dissemination of SMS data in Dishfire."

GCHQ has so far refused to comment on the matter, but insisted all its intelligence activities are in compliance with UK law.