The Montreal Canadiens reached one million Twitter followers on Tuesday and decided to thank their fans, but ended up creating a public relations snafu instead.

The @CanadiensMTL feed was programmed to thank followers with videos and messages.

Videos of different team members were sent randomly to followers

Some people used the opportunity to criticize the team — and its coach

Habs million followers thank you tweet

Others created offensive Twitter handles, or used racist, sexist and obscene language. Many of the tweets were later deleted.

Offensive Habs thank you tweet
Habs ISIS Tweet

The Montreal Canadiens realized what had happened and started pulling down their own automated messages as well.

Team tweeted an apology

The Canadiens aren't the first NHL team to have a Twitter campaign hijacked.

In 2014, the Pittsburgh Penguins' #AskNeil hashtag was co-opted by fans who wanted to know about James Neal's history of causing head injuries.

In 2013, the Toronto Maple Leafs used #SEAofBLUE for fans to tweet their support and see those messages on the website's main page. Fans soon noticed tweets were sent to the homepage unfiltered and used #SEAofBLUE to ridicule the team.