A 28-year-old Toronto man has been arrested after allegedly using social media to threaten a police officer in a dispute over a transgender flag being displayed on city property.

According to a news release issued Friday, the man replied to a Toronto Police Service (TPS) social media post on Nov. 28 and demanded that a transgender flag be taken down from city property. The man allegedly threatened to harm the officer if the flag was not removed.

In a statement sent to CTV News, TPS said that the social media post related to the raising of the flag for Trans Day of Remembrance, which happened on Nov. 20.

The accused, Robert Ranieri, was arrested by members of TPS' Hate Crime Investigation Unit on Dec. 1 and charged with two counts of uttering threats.

He was scheduled to appear in court at the Ontario Court of Justice that same day at 10 a.m.

Police say that the matter is being treated as a suspected hate-motivated offence.