MONTREAL -- A Quebecer who used Twitter to harass celebrities including singer Avril Lavigne and Montreal Canadiens forward Max Pacioretty has been put on probation for two years.

Jean-Francois Champagne has also been sentenced to 140 hours of community service.

The 23-year-old faced six different charges, including criminal harassment.

Judge Maurice Galarneau said his sentence took into account Champagne's behaviour since the incidents, which occurred between February and March 2011.

Champagne respected court-ordered conditions, stopped contacting his victims and refrained from using computers.

He is not allowed to contact his victims for the next two years and is prohibited from taking part in any social media networks.