A second man arrested and charged in the iCloud and Gmail hack of hundreds of private nude celebrity photos faces up to five years in prison in a plea deal, authorities have announced.

Edward Majerczyk, 28, of Chicago executed a "phishing" scam to trick users into giving up their usernames and passwords from late 2013 to August 2014. He then used the information to gain access to private photos and videos in the victims' accounts.

The operation led to what's known as The Fappening or Celebgate, a massive leak of hundreds of embarrassing private nude photos almost exclusively of famous women. Actresses Jennifer Lawrence, Kate Upton, Kirsten Dunst, Vanessa Hudgens, singer Rihanna and soccer star Hope Solo were all caught in its net.

Lawrence called the invasion a "sexual violation. It's disgusting."

She added: "It's my body and it should be my choice, and the fact that it is not my choice is absolutely disgusting. I can't believe that we even live in that kind of world. "

Majerczyk has not been charged in the leak of the nudes — only with accessing them.

He has pleaded guilty to felony unauthorized access to a protected computer to obtain information under the federal Computer Fraud and Abuse Act, according to a statement from the US Department of Justice.

In March, US officials also charged 36-year-old Ryan Collins of Pennsylvania for his actions in the hack. Authorities claimed that Collins had gained access to at least 50 iCloud and Gmail accounts. In contrast, Majerczyk was able to access more than 300 Apple iCloud and Gmail accounts.

Collins also pleaded guilty to illegal access as part of a plea deal and also faces up to five years in prison, but is yet to be sentenced.

Referring to Majerczyk, Deirdre Fike, the assistant director in charge of the FBI's Los Angeles field office, noted that he "not only hacked into email accounts — he hacked into his victims' private lives, causing embarrassment and lasting harm."

"Hacking of online accounts to steal personal information is not merely an intrusion of an individual's privacy but is a serious violation of federal law," US Attorney Eileen Decker said in a statement.