A Chicago man has been sentenced to nine months in federal prison for hacking the online accounts of numerous celebrities, including Jennifer Lawrence, and stealing private information such as nude photos and videos. Edward Majerczyk, 29, was also ordered to pay $5,700 (£4560) in restitution to one unnamed celebrity victim, whose photos were leaked online, to cover counselling services, according to the US Attorney's office, Reuters reports.

Majerczyk was accused of orchestrating a phishing scheme by sending emails that appeared to be from internet service providers to trick victims into divulging their usernames and passwords. He then used those credentials to illegally access over 300 email and storage accounts of various celebrities between November 2013 and August 2014.

The so-called "Celebgate" or "Fappening" leak saw over 500 photos stolen from at least 30 celebrities' iCloud and Gmail accounts, many of which contained nudity, posted on websites such as Reddit, 4chan and Imgur.

Although there were no victims named in the court documents, some of the celebrities affected in the hack included model Kate Upton, actress Kirsten Dunst and US soccer player Hope Solo. Many celebrity victims publicly addressed the leak in interviews after their private photos were widely disseminated online on various websites.

While handing down the sentence, US District Judge Charles Kocoras said cyberattacks such as the one carried out by Majerczyk were the result of living in a world that "inspires secrecy and anonymity and intrusion into the affairs of people's private lives".

"The conduct is abhorrent," Kocoras said, the Chicago Tribune reports. "It's a very, very trying time that we live in."

In September last year, he pleaded guilty to one count of unauthorised access to a protected computer to obtain information which carries a maximum penalty of five years in prison. However, he was not charged or accused of selling or posting the stolen information online.

Majerczyk, a son of two retired Chicago policy officers, will begin serving his sentence on 27 February, Joseph Fitzpatrick, a spokesman for Zach Fardon, US Attorney for the Northern District of Illinois, told Reuters.

"At the time of the offence, Mr Majerczyk 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," Majerczyk's attorney Thomas Needham wrote in a sentencing memo on 19 January.

Needham said Majerczyk had "consistently expressed remorse" for his actions and was "deeply affected" by the fallout of the Celebgate hack. He also said Majerczyk has seen a therapist for anxiety and panic attacks as well.

However, Needham said the stolen material was for Majerczyk's "personal use and viewing", emphasising that his client made no effort to sell or distribute the photos.

Lawrence called the leak a "sex crime" in a 2014 interview with Vanity Fair.

"I was just so afraid. I didn't know how this would affect my career," Lawrence said. "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. 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 is not the only one facing jail time for the celebrity hack scandal.

In October 2016, 36-year-old Ryan Collins from Lancaster, Pennsylvania, was sentenced to 18 months in prison for executing a similar phishing scheme to obtain illegal access to more than 600 victims' online accounts, including those of celebrities. Collins was not charged with uploading or sharing the private photos and videos online either.