Selena Gomez’s Facebook account was hacked in early 2011, and now the man behind the takeover will be serving jail time for his crimes.

The 21-year-old British hacker, Gareth Crosskey, has been sentenced to one year in prison for the January 2011 incident in which he gained unauthorized access to Gomez’s Facebook account. Through the hack, the West Sussex native also obtained personal exchanges between the pop star and her boyfriend, Justin Bieber, as well as messages between Gomez and Demi Lovato.

According to a press release from London’s Metropolitan Police, Crosskey had pleaded guilty at an earlier hearing to charges under the Computer Misuse Act. “Today’s result should act as a deterrent to any individuals thinking of participating in this type of criminal activity,” police wrote.

The hacker was tracked down by authorities after reportedly posting a video of himself bragging about his crimes. Judge John Price, who presided over the case, said to Crosskey:

“You are clever with a computer and you hacked into the private part of somebody’s Facebook account. Selena Gomez had a Facebook account on which she has six million friends. They have permission to get into part of the account and you hacked into a private part by getting the email password.”

And with that, justice has been served.

Watch the Selena Gomez ‘Hit the Lights’ Video (Version 2)