Police say the group at Hamilton North School in the North Island were left with moderate injuries after getting shocked despite being inside a block of classrooms during a thunderstorm on Monday afternoon.

Principal Tony Kane told local media a massive lightning bolt struck a post at a neighbouring field and jumped to the building, setting off smoke detectors throughout the school.

Eight children inside the class were also checked by ambulance crews, a spokeswoman said.