The New England Patriots are apologizing after sending out a tweet to thank a "fan" with a racist Twitter handle.

The Patriots were holding a promotion to celebrate becoming the first NFL team with 1 million Twitter followers.

The team asked fans to retweet a message about the achievement. For each fan who did so, an automated system generated a message that included an image of a jersey with that person's Twitter handle on it.

When someone with a racist Twitter handle retweeted the message, the system generated an image of a Patriots jersey with the racist name on the back.

That tweet was quickly deleted, and the Patriots issued a statement that apologized. The team says a filtering system failed.

A team spokesman on Friday declined additional comment.

More From ESPN Western Colorado