A Chicago man has been sentenced to jail for his involvement in so-called “Celebgate” hacking.
Edward Majerczyk will serve nine months in jail and pay $5,700 in restitution for hacking the iCloud and Gmail accounts owned by dozens of celebrities, including Academy Award winning actress Jennifer Lawrence, according to the Guardian, which earlier reported on the sentence. In a plea deal Majerczyk, 29, said he used phishing attacks to target his victims and steal their passwords. Upon doing so, he illegally obtained access to their accounts and leaked the celebrities’ emails and private photos.
Phishing scams are a common method for hackers to obtain access to an unsuspecting victim’s data. The hackers create fake emails that claim to come from a company. Often, those emails warn of a hack or other security concern and request victims input their passwords to safeguard themselves. In reality, those victims are sending their credentials to the hackers, who then access their accounts.
Get Data Sheet, Fortune’s technology newsletter
Lawrence was among 30 celebrities who were hacked as part of the “Celebgate” scandal in 2014. Most of the targeted celebrities were women. The hackers, who included Majerczyk and Ryan Collins of Pennsylvania, obtained credentials to the celebrities Gmail (googl) accounts, as well as their iCloud (aapl) accounts, where private photos were stored. Approximately 500 private pictures were published, including some that contained nudity, to imageboard site 4chan. Before long, the images and emails went viral across the Internet.
Other celebrities who confirmed they were targeted in the attacks were model Kate Upton and actress Kirsten Dunst. The $5,700 in restitution Majerczyk must pay back is a reimbursement to one unidentified celebrity for counseling services.
The U.S. Department of Justice issued a statement in July announcing that Majerczyk had been charged with felony computer hacking in connection with Celebgate. Deidre Fike, assistant director in charge of the FBI’s Los Angeles Field Office, said at the time that Majerczyk “hacked into his victims’ private lives, causing embarrassment and lasting harm.”
For more about iPhone, watch:
According to the Guardian, Majerczyk’s attorney Thomas Needham said in a court filing that Majerczyk hacked the celebrities because 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 added that Majerczyk is now suffering from anxiety and panic attacks.
Still, Majerczyk could have faced far more time in jail. Last year when he was charged by the Justice Department, he was facing a maximum sentence of five years in federal prison. His nine-month sentence is also shorter than the 18-month sentence Collins received in October.