Federal prosecutors charged a Pennsylvania man with felony computer hacking related to the theft of hundreds of nude photos of Jennifer Lawrence, Ariana Grande, Kate Upton and other female celebrities.

Ryan Collins, 36, of Lancaster, Pa., signed a plea agreement with the U.S. Attorney’s office in Los Angeles, officials said Tuesday. Collins gained illegal access to at least 50 Apple iCloud accounts and 72 Google Gmail accounts, most belonging to Hollywood celebs, they said.

Collins could face up to five years in prison. Prosecutors said they will recommend he serve a term of only 18 months in exchange for a guilty plea but that the recommendation will not be binding on the sentencing judge.

In August 2014, nude photos of about 100 celebrities were posted online, including those from private accounts of “Hunger Games” star Jennifer Lawrence, Kate Upton, Selena Gomez, Ariana Grande, Kirsten Dunst, Kim Kardashian, Vanessa Hudgens, Rihanna, Lea Michele and Hillary Duff.

However, according to officials, investigators have not discovered evidence that Collins shared or uploaded the photos he purloined.

“By illegally accessing intimate details of his victims’ personal lives, Mr. Collins violated their privacy and left many to contend with lasting emotional distress, embarrassment and feelings of insecurity,” David Bowdich, assistant director in charge of the FBI’s L.A. field office, said in a statement. “We continue to see both celebrities and victims from all walks of life suffer the consequences of this crime and strongly encourage users of Internet-connected devices to strengthen passwords and to be skeptical when replying to emails asking for personal information.”

According to U.S. officials, between November 2012 and September 2014, Collins engaged in a “phishing” scheme to obtain usernames and passwords for his victims using emails that appeared to be from Apple or Google asking for usernames and passwords. In some instances, Collins downloaded the entire contents of the victims’ Apple iCloud backups, according to prosecutors.