The find – a .22 calibre handgun – caused police to place the Wave Preparatory Elementary School in the Far Rockaway neighbourhood of Queens on lockdown for about an hour.
The student has not been identified, and police declined to specify whether the gun was loaded. An investigation into the incident is ongoing.
Thursday morning’s discovery came during a heated debate about gun control in the United States sparked by the December 14 shooting at the Sandy Hook Elementary School in Newtown, Connecticut, that claimed the lives of 20 first graders and six adults.
On Wednesday, President Barack Obama unveiled sweeping proposals to stem gun violence in the wake of the Newtown massacre, demanding an assault weapons ban and universal background checks for gun buyers.