Firefighters were called out to Woodmill High, in the Abbeyview district of Dunfermline, at 5.05pm.
Multiple appliances and more than 80 firefighters were sent to battle a "very large and complex" blaze at the secondary school.
Hundreds of onlookers gathered around the building when the blaze took hold.
Speaking at the height of the fire, deputy assistant chief officer Stuart Stevens said: "This is a very large and complex incident and our firefighters continue to work in difficult conditions to extinguish the flames."This will be a prolonged incident and our advice to nearby residents and members of the public is to avoid the area to allow access for emergency service vehicles, and close doors and windows due to high volumes of smoke," Mr Stevens said.
The school was closed for the weekend when it was reported and it has since been confirmed there were no casualties.
The blaze broke out in the Department of Additional Support, a single storey extension to the rear of the property.
The school, which is operated by Fife Council, dates from 1958. One of four high schools in the town, it is one of two still waiting for substantial modernisation works to take place.
Shelagh McLean, Head of Education & Children’s Services said: "We are all really shocked and upset to hear that there has been a significant fire at Woodmill High School this evening. Thankfully no-one is hurt. The fire appears to have been contained to the Department of Additional Support and the dining hall. This is still devastating news for staff, pupils and the school community.
"Firefighters were on the scene promptly and we'd like to thank them for their hard work.
"Staff are on site but a decision has been taken to close the school to all pupils until the damage can be fully assessed. We will update pupils and parents as soon as possible tomorrow. "