The FBI has arrested a man on charges of threatening to kill police officers in a suburb north of New York City, officials said on Tuesday.

The man, identified as 24-year-old Jeremy Mott of Mount Vernon, New York, posted messages on Facebook and Instagram in December threatening to injure and kill police in the town, according to a criminal complaint in U.S. District Court.

It said that one threat posted on Dec. 24 on Facebook showed a digital image of someone firing a gun into a police vehicle, with a message that read in part: "the cops in Mount Vernon . . . This is how they going to end up."

The threat was made days after two New York City police officers were ambushed and shot dead in Brooklyn on Dec. 20 by a man who wrote on social media that he wanted to avenge the deaths of two unarmed black men last summer in encounters with white police officers in Ferguson, Missouri, and New York.

The police killer committed suicide minutes later.

Mott was released on bond following an appearance in federal court in White Plains, New York, before U.S. Magistrate Judge Lisa Margaret Smith, the Federal Bureau of Investigation and the prosecutor's office said.

New York City Police Commissioner William Bratton said last week that there had been more than 80 threats against police on social media in the previous week that had led to at least 15 arrests.

Mott is charged with one count of making interstate threats. If convicted, he faces the possibility of five years in prison.