Josiah Livingston, of Hartford, was arrested and charged with assault and battery, Springfield police said. The person who fired the weapon remains at large.
The incident began just after 2 p.m. when four people, including a female student, were spotted standing outside the High School of Science and Technology at 1250 State Street.
When a teacher cracked open a security door to tell them to leave, someone in the group grabbed the handle and wrenched it open, forcing their way inside, police said.
They attacked one student, though the extent of their injuries was not known.
Livingston was arrested in a bathroom trying to clean pepper spray off of his face after a security officer doused him with the caustic substance, police said.
Springfield police are investigating the incident.
Click here to follow Daily Voice Springfield and receive free news updates.