A prolific Facebook spammer was sentenced yesterday to two-and-a-half years in prison by a federal judge in San Jose and ordered to pay $310,000 in restitution. The Associated Press reports that the Las Vegas man sent over 27 million spam messages on the social media service.

Sanford Wallace, who The Daily Mail reports called himself the "Spam King," admitted to illegally accessing over a half million Facebook accounts in late 2008 and early 2009, via a phishing scam, and using those accounts to post spam links on the users' friends' Facebook walls. He automated the process, and received payment from sites to which he redirected unsuspecting Facebook users.

Judge Edward Davila, who oversaw the case, also sentenced Wallace to five years probation after completion of his prison sentence. During that time, he will not be allowed to access a computer without the permission of his probation officer.

This was not Wallace's first dive into the world of spam — according to the Mail he once ran a company called Cyber Promotions that in the 1990's sent upwards of 30 million junk emails per day.

Computerworld reports that Wallace could have been sentenced to up to 16 years in prison. He is set to begin his sentence on September 7.

Related: Facebook Users Report Over A Million 'Violations' Every Day