Administrators at International Preparatory School #198 on Buffalo's West Side were made aware Monday of a threat to the school through social media.
Buffalo Public School District spokeswoman Elena Cala said the message threatened that an incident might occur outside the school during the dismissal. School officials called 911 and the school was placed on lockout.
Dismissal was delayed during the investigation, Cala said.
The school was declared safe about an hour later and the lockout was lifted, she added.
Buffalo police spokesman Michael DeGeorge said a 17-year-old former student was later arrested and charged with making a terroristic threat.