A computer hacker was sentenced to 24 months behind bars on Friday for launching a virus that infected approximately 100,000 computers worldwide and directed them to attack media outlets that carried stories about him, federal prosecutors said.

The sentencing of Bruce Raisley, 48, of Kansas City, Missouri, was announced by the New Jersey U.S. Attorney's Office. He was convicted six months ago of launching a malicious computer program designed to attack computers and Internet sites.

Raisley was formerly a volunteer for the organization Perverted Justice, which works with police and the popular NBC reality TV show To Catch a Predator. It features hidden camera investigations of adults trolling for sex with underage girls and boys.

According to court documents, Raisley left the organization after a dispute with the group's founder, Xavier Von Erck.

An angry Van Erck retaliated by pretending to be a woman named Holly and starting an online relationship with Raisley, who eventually agreed to leave his wife for Holly, prosecutors said in a press release.

He was later photographed by a Perverted Justice volunteer at the airport waiting for Holly to arrive, prosecutors said.

The incident was mentioned in articles published by Radar Magazine and Rolling Stone and republished by several websites.

Court documents say that Raisley then developed a computer virus to attack the websites where the articles were posted. It remotely prompted computers to launch denial of service attacks on the sites, overwhelming the targeted computers with multiple accesses and causing them to crash.

In addition to the two-year prison sentence, Raisley must also pay over $90,000 in restitution to the affected websites.

(Reporting by Bernd Debusmann Jr.; Editing by Barbara Goldberg and Greg McCune)