Firefighters from Lowedges, Central and Birley Moor stations were called to Meadowhead School on Dyche Lane, Sheffield at 11:55pm on Tuesday night.
When crews arrived the fire was found to be in an art room in the art block and the sprinkler system had actuated.
Firefighters wearing breathing apparatus entered the building and quickly extinguished the fire which was already under control due to the sprinklers.
Fire crews left the scene at 2am.
An investigation into the cause of the fire will now take place.
Head of prevention and protection Steve Helps, said: “As this incident proves automatic fire sprinklers are most effective during the initial stage of a fire occurring, as a properly installed sprinkler will detect the flames heat, initiate an alarm, and activate just moments after the flames appear.
“When you consider the huge costs associated with a school fire such as rebuilding, temporary relocation, loss of equipment and pupil’s academic work, it seems like an obvious move to install sprinkler systems such as this in schools.
“Above everything else, sprinklers give added protection to the pupils and staff at the school, and the firefighters who respond to tackle the fire.
“I am really pleased that this sprinkler system did its job and doused the flames to prevent it spreading to other parts of the school.”