London - Millions of webcam images from internet users not suspected of wrongdoing were collected by British spy agency GCHQ with the help of the US National Security Agency (NSA), secret documents seen by the Guardian newspaper revealed Thursday.
The programme, codenamed Optic Nerve, gathered millions of webcam images from Yahoo users from 2008-12, transferring them to agency databases regardless of whether users were terrorism suspects, the report says.
The documents, leaked by former NSA contractor Edward Snowden, show that the programme saved one image every five minutes to circumvent human rights legislation and to avoid overloading the agencies' servers.
The shots frequently included sexually explicit images and were subsequently fed into NSA computer systems for analysis.
According to the report the aim of the program was to collate a massive database of facial images that could be used to search for terrorism suspects or criminals.
"Face detection has the potential to aid selection of useful images for 'mugshots' or even for face recognition by assessing the angle of the face," according to one of the GCHQ documents quoted by the Guardian.
"The best images are ones where the person is facing the camera with their face upright."
GCHQ insists all of its activities are proportionate and in compliance with British law.
Yahoo denied any prior knowledge of the programme.
"This report, if true, represents a whole new level of violation of our users' privacy that is completely unacceptable, and we strongly call on the world's governments to reform surveillance law," the company said.