Police said Ryan Roderick was wearing hospital identification on his wrist, and holding a radio device in one hand and the glass vial containing an amber liquid in the other when entered J.H.S. 162 on Saint Ann's Avenue Friday morning.
He held up the vial and claimed it was a "chemical nerve agent," according to the New York City Police Department.
Roderick then left, prompting a brief school evacuation.
He was caught five hours later and has been charged with making terroristic threats.
The liquid from the container was tested at a state health department facility in Westchester Friday night and deemed non-toxic.
It also will be tested at a federal facility in Maryland.