British spy agency GCHQ intercepted webcam images from millions of Yahoo users around the world, according to a report in the Guardian.
According to leaked documents, sexually explicit images were among those gathered – although not intentionally.
In a statement GCHQ has said all of its actions are in accordance with the law.
The operation, which was called Optic Nerve and was aided by the US National Security Agency, is alleged to have stored images between 2008 and 2010. In one six-month period in 2008, images from 1.8m users were gathered.
The report originated from documents leaked by whistleblower Edward Snowden.
It suggested that sexually explicit content would be captured by the system.
“Unfortunately … it would appear that a surprising number of people use webcam conversations to show intimate parts of their body to the other person,” it read.
“Also, the fact that the Yahoo software allows more than one person to view a webcam stream without necessarily sending a reciprocal stream means that it appears sometimes to be used for broadcasting pornography.”