Prompt action by a passing jogger helped save Salendine Nook High School from a major blaze last night.
The drama began at 9.20pm when two fire engines from Huddersfield Fire Station were called to the premises on New Hey Road.
Watch commander Andy Blackburn said a "very large skip" overflowing with materials was alight and just two metres away from the main building.
He said: "It took us a couple of minutes to gain access because of the security arrangements.
"We were there over an hour putting it out but thanks to this jogger's prompt actions in phoning us on his mobile he has saved the school. It could easily have got hold of it.
"There were two large skips in the area which couldn't be emptied because the position of two stand alone school rooms meant the wagon couldn't get in to access them."
A school spokeswoman said: "We have had building work taking place. The rooms have been relocated."
Police are investigating the cause of the blaze.