Chicago resident Edward Majerczyk pleaded guilty and was sentenced to nine months of jail time for his participation in “Celebgate” nude celebrity photos hacking scandal.

He was also ordered to pay $5,700 to cover half the bill of counseling services obtained by a victim whose photographs were spread online and has gone viral.

According to the information gathered by the authorities, Majerczyk carried out a massive phishing scheme that targeted people he came across in his life, celebrities and other famous personalities.

Edward Majerczyk, right, leaves the federal courthouse in Chicago on Jan. 24, 2017, after he was sentenced to nine months in prison for the “Celebgate” hacking scandal. (Jose M. Osorio / Chicago Tribune)

In his plea deal, he said that he sent emails to his victims that are formatted to look like an official email from their respective internet service providers, seeking private and delicate info such as usernames and passwords.

Majerczyk said that he immediately and illegally accessed the accounts of people who provided their information.

This scheme allowed him to access around 300 Apple iCloud and Gmail accounts including those that belong to at least 30 celebrities, such as Jennifer Lawrence, Kate Upton, Kirsten Dunst and soccer player Hope Solo.

However, Majerczyk was not charged nor accused of posting or selling the images he hacked.

The hacking (phishing) scheme gave way to a wider leak that came to be known as Celebgate. This second wave of attack targeted over a hundred of celebrities and famous personalities.

Their information and photos spread like a wildfire online, particularly on Reddit and 4chan.

Along with Majerczyk, two other people have been convicted of conducting similar phishing attack – Ryan Collins who was sentenced to 18 months and Andrew Helton who was sentenced for 6 months and asked to pay $3000.

In Majerczyk’s defense, his attorney said that he was “suffering from depression and looked to pornography websites and internet chat rooms in an attempt to fill some of the voids and disappointment he was feeling in his life.”

He also added that the fallout from the whole hacking scandal “deeply affected” him and has seen a therapist for anxiety and panic attacks.

Some of the celebrities who are affected by the iCloud leaks of photos already spoke about it in the past. In 2014, Jennifer Lawrence called the iCloud hacking and leaking of her private photos a “sex crime.”

“I was just so afraid. I didn’t know how this would affect my career,” Lawrence said in an interview.

“Just because I’m a public figure, just because I’m an actress, does not mean that I asked for this. It does not mean that it comes with the territory.”