Christopher Brannan, 31, of Virginia, was sentenced Friday to 34 months in prison for his role in the 2014 'cebegate' hacking scandal

A former Virginia high school special education teacher has been sentenced to nearly three years in prison for hacking into private online accounts of celebrities, including Jennifer Lawrence, as well as 200 other people.

Christopher Brannan, 31, was the fifth person charged in the 2014 'celebgate' scandal, in which multiple hackers obtained nude photographs and other private information from Hollywood A-listers like Lawrence, Mary Elizabeth Winstead, Kate Upton and Kirsten Dunst, who've publicly acknowledged they were victims.

'It is not a scandal. It is a sex crime,' Lawrence told Vanity Fair in 2014. 'It is a sexual violation. It's disgusting. The law needs to be changed, and we need to change.'

Investigators said Brannan also unlawfully accessed the internet history and email accounts of his students, fellow teachers and even his own sister-in-law, who was a minor at the time, while he was working at Lee-Davis High School in Richmond from August 2013 to June 2015.

Brannan was accused of accessing personal information belonging to actresses Jennifer Lawrence (left) and Mary Elizabeth Winstead

Kirsten Dunst (left) and Kate Upton (right) have publicly acknowledged that they were victims of the hacking scandal

Brannan pleaded guilty in October 2018 to aggravated identity theft and unauthorized access to a protected computer.

According to court documents, the Virginia educator intentionally hacked into the victims' Apple iCloud, Yahoo!, and Facebook accounts, and obtained complete iCloud backups, photographs, and other private data.

He was able to access email accounts by answering security questions that he could easily research by reviewing his targets' Facebook accounts.

Brannan also used phishing email accounts designed to look like legitimate security accounts from Apple, according to federal prosecutors.

'Because of the victims’ belief that the email had come from Apple, the victims would provide their usernames and passwords,' according to a press release from the US Attorney's Office for the Eastern District of Virginia. 'Brannan would then access the victims’ email accounts, and search for personal information such as sensitive and private photographs and videos, including nude photographs.'

Brannan also accessed the internet history and email accounts of his students and fellow while he was working at Lee-Davis High School in Richmond from August 2013 to June 2015

At Friday's hearing, the disgraced former teacher apologized before being sentenced to 34 months in prison. He said he suffered from anxiety and depression, and became addicted to pornography.

Brannan was fired from his teaching job after FBI investigators alerted school officials of the hacking scheme.

Four other men convicted in connection to 'celebgate' have been handed prison terms ranging from six to 18 months.

George Garofano, 26, of Connecticut, was sentenced last August to eight months in prison after pleading guilty to one count of unauthorized access to a protected computer to obtain information.

Co-conspirators: Edward Majerczyk (left), 29, from Chicago, was sentenced last year to nine months in federal prison. Ryan Collins (right), 36, a father-of-two from Pennsylvania, was sentenced in 2016 to 18 months in prison

Chicago resident Emilio Herrera was sentenced last year to 16 months in prison after federal prosecutors charged him in a phishing scheme that gave him illegal access to more than 550 Apple iCloud and Gmail accounts.

Another Illinois man, 29-year-old Edward Majerczyk, was sentenced last year to nine months in federal prison.

Ryan Collins, 36, a father-of-two from Pennsylvania, was sentenced in 2016 to 18 months in prison in connection to the hacking plot.