A former Yahoo software engineer on Monday pleaded guilty to hacking the accounts of thousands of Yahoo users in search of sexual images and videos of young women and coworkers, federal authorities said.

Reyes Daniel Ruiz, 34, of Tracy, California copped to a computer intrusion charge for using his work access to crack the passwords of roughly 6,000 Yahoo accounts, primarily younger women, according to the US Attorney’s office in the Northern District of California.

Ruiz, who even targeted his friends and coworkers, made copies of the personal images and videos, then stored the content on his home computer.

He also admitted to “compromising the iCloud, Facebook, Gmail, DropBox, and other accounts of the Yahoo users in search of more private images and video,” authorities said.

After Yahoo detected the suspicious account activity, Ruiz told authorities he destroyed the computer and hard drive where he stored the photos.

His sentencing is set for Feb. 3. He faces up to five years in prison.