Officials say 31 students and nine adults were exposed to the spray inside P.S. 219 just after 10:45 a.m.
Of that group, eight students and two adults were taken to New York Presbyterian Queens.
The rest were checked out at the scene and declined further medical attention.
Authorities believe it was an accidental discharge.
The Department of Education released a statement and said that safety of everyone in their school buildings is a priority:
"A pepper spray device was discharged in a school cafeteria, and all impacted students and staff were immediately evaluated by EMS. We are offering additional security and supports to the school community today and in the coming days and are working closely with the NYPD regarding follow-up actions. A reminder for parents, pepper spray and other 'personal safety devices' are not allowed in schools."
ALSO READ | Gov. Murphy calls Amtrak, NJ Transit suspensions 'an unmitigated disaster' in blistering letter
Amtrak, NJ Transit slammed by Gov. Murphy
----------
* More Queens news
* Send us a news tip
* Download the abc7NY app for breaking news alerts
* Follow us on YouTube