Twitter has apologised for failing to take action against the man suspected of mailing pipe bombs to critics of US president Donald Trump.

Cesar Sayoc, 56, came to the attention of the social media company two weeks before the alleged attacks when he sent a threatening tweet to Democratic strategist Rochelle Ritchie.

Ms Ritchie’s complaint was rejected by support staff at the social media giant, who decided the message did not violate the rules against abusive behaviour.

Twitter has now admitted it “made a mistake” and said it is “deeply sorry for that error”. Mr Sayoc’s accounts have been suspended.

Ms Ritchie made her complaint to Twitter on 11 October after receiving a message from Mr Sayoc, using the username @hardrock2016. It ended with the words: “Hug your loved ones real close every time you leave you home.”

Support staff replied the same day to tell her: “We have reviewed your report carefully and found that there was no violation of the Twitter rules against abusive behaviour.”

Support free-thinking journalism and attend Independent events

Ms Ritchie tweeted on Friday: “Hey @Twitter remember when I reported the guy who was making threats towards me ... Well guess what it’s the guy who has been sending #bombs to high profile politicians!!!!”

Within a few hours Twitter had suspended the account.

“Please disregard our last reply as it was sent in error,” the company told Ms Ritchie. “We apologise for any inconvenience. We’ve investigated and suspended the account you reported as it was found to be participating in abusive behaviour.”

Ms Ritchie replied: “Oh so it was an error. Just stop!”

The company said in a statement: “We made a mistake when Rochelle Ritchie first alerted us to the threat made against her.

“The Tweet clearly violated our rules and should have been removed. We are deeply sorry for that error. We are investigating what happened and will continue to work to improve how we handle concerns raised by anyone on Twitter. We want Twitter to be a place where people feel safe, and we know we have lot of work to do.”