BUFFALO, N.Y. (AP) — A 22-year-old western New York man accused of posting a threat on Facebook to kill police has pleaded guilty to a gun charge.

Arthur Jordan of Buffalo pleaded guilty Wednesday in State Supreme Court to criminal possession of a weapon.

Authorities say Jordan, a local gang member, had an illegal weapon when officers approached him to ask about an alleged threat he made on Facebook to kill police officers. The threat appeared right after police shootings in Louisiana and Minnesota and a police ambush in Dallas that resulted in the deaths of two black men and five police officers.

Jordan faces from 3 ½ to 15 years in prison when he's sentenced Oct. 27, 2016. He's being held without bail in Erie County Jail.

[STORY BY: THE ASSOCIATED PRESS]

More From WIBX 950