A British intelligence agency reportedly intercepted and stored millions of images from Yahoo users' video chats.

Under a program code-named Optic Nerve, the Government Communications Headquarters, or GCHQ, would collect still images in bulk from users when they chatted with others via webcam through Yahoo, the Guardian reported on Thursday. The report cited documents provided by U.S. surveillance program leaker Edward Snowden.

During a six-month period in 2008, the GCHQ collected images from more than 1.8 million Yahoo users through the Optic Nerve program, the report said. Most of the users were not suspected of any wrongdoing.

PHOTOS: 10 ways to use the sharing economy

The point of the program was to capture pictures of users' faces that could be stored in a database. The database could then be used to search for terror 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," one of the GCHQ documents said, according to the Guardian. "The best images are ones where the person is facing the camera with their face upright."

However, the still images taken by Optic Nerve were not limited to users' faces, the report said. The Guardian reported that a number of images taken from the Yahoo video chats were sexually explicit. The GCHQ documents said that between 3% and 11% of the pictures contained "undesirable nudity."

"Unfortunately … it would appear that a surprising number of people use webcam conversations to show intimate parts of their body to the other person," one of the documents said. 

The GCHQ collected the images with the help of the U.S.'s National Security Agency, the report said. It was unclear how much access the NSA had to the British agency's database of collected images.

Yahoo said it was not aware of the program and did not condone it.

"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 consistent," the company said in a statement.

ALSO:

Snakebyte Vyper functions as tablet, smart TV and game console

Has Occupy movement come to Silicon Valley? Vandals strike Atherton

Google hopes to deliver $50 customizable modular phones by early 2015