An investigation into a fire at Betws Primary School in Bridgend yesterday has revealed an overheating table fan to be the cause.
Staff and all 230 children escaped unharmed from the school, which is based around six miles from the centre of Bridgend.
It has reopened today, although the junior section was heavily damaged in the blaze.
South Wales Fire and Rescue say the fire was isolated to the junior part of the school, but they were surprised at the extent of it.
Residents living within the area were advised to keep their doors and windows closed as a precautionary measure.