Firefighters were called out to Woodmill High, in the Abbeyview district of the town, at 5.05pm.
Nine appliances, carrying more than 40 firefighters, were sent to the secondary school.
The Scottish Fire and Rescue Service asked members of the public to keep nearby access roads clear to allow appliances to pass through as required.
Hundreds of onlookers gathered around the building when the blaze took hold.
The school was closed for the weekend when it was reported and there are no reported 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.
Smoke from the fire could be viewed from across West Fife.
Fife Council confirmed the school would be closed to all pupils on Monday.
Shelagh McLean, head of education at the local authority, 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. “