A British intelligence agency allegedly intercepted and stored images - many of them sexually explicit - from the webcams of millions of Yahoo users, "regardless of whether they were suspected of illegal activity," The New York Times reported.

The Britain's surveillance agency GCHQ was involved in a secret program called Optic Nerve, which collated a digital mugbook of sorts, "snapping screenshots every 5 minutes or so from user feeds," Fox News reported. The program targeted users indiscriminately.

Fox News reported that in one six-month period alone in 2008, more than 1.8 million Yahoo user accounts from around the world were accessed.

A Yahoo spokeswoman told The Guardian they had no prior knowledge about Optic Nerve and they accused the spies of "a whole new level of violation of our users' privacy."

"We strongly call on the world's governments to reform surveillance law consistent with the principles we outlined in December," she said.

GCHQ began scooping image data from Yahoo accounts, with aid from the U.S. National Security Agency, between 2008 and 2012 under the Optic Nerve program. The revelations are based on secret documents taken by former NSA contractor Edward Snowden, which have led to international outrage over the stunning extent of oversight of Internet activities.

A spokeswoman for GCHQ told Fox News that the agency's work is "carried out in accordance with a strict legal and policy framework which ensures that our activities are authorized, necessary and proportionate."

NSA spokeswoman Vanee Vines told The Guardian that the agency did not ask "foreign partners to collect data it could not legally collect itself."

"As we've said before, the National Security Agency does not ask its foreign partners to undertake any intelligence activity that the U.S. government would be legally prohibited from undertaking itself," Vines said.