A teenage boy has been charged following a “suspicious” blaze at Woodmill High School in Dunfermline, police have said.
The 14-year-old will appear in court on Tuesday over the incident.
Scottish Fire and Rescue Service says more than 80 firefighters have been dealing with the fire, which started on Sunday evening.
Crews remained on the scene well into Monday morning as the flames spread through the building.
The school, located about 20 miles north-west of Edinburgh, is closed to all pupils.
A message on the school’s Twitter account by rector Sandy McIntosh said: “We are all utterly devastated by what has happened to our school.
“I will be meeting with our teachers and school staff this morning, along with staff from the Education Service and wider Fife Council to put in place plans for our young people.
“My heartfelt thanks go to the Emergency Services for all they have done to save our school.”
Deputy First Minister John Swinney also said: “Terribly sorry with the news @WoodmillHigh. @scotgov has been in contact with @FifeCouncil and will discuss next steps. Good wishes to all in the school community at this tough time.”
Speaking on BBC’s Good Morning Scotland, local councillor Fay Sinclair, convener of Fife’s education and children’s services committee, said flames could still be seen coming from the building on Monday morning.
She also said: “Plans started to be put in place yesterday; that was when we thought the fire was confined to the (department of additional support).
“Obviously those are some of our more vulnerable pupils who need a lot of support and we are still getting something in place for them as soon as possible as an absolute priority.
“Over the night the picture’s changed somewhat. The main building is now damaged and so the council’s emergency teams will be meeting this morning to start looking at what are the options here.
“We’re talking about 1,400 pupils displaced from the school at least for the short term.
“Dunfermline’s been a rapidly growing town over recent years, all of the schools are very full so there’s not an immediate place to move all of these pupils to.
“The pupils have only been back for three days… not being back in this morning is going to be very hard for a lot of them.”
No casualties have been reported. Monday is not a bank holiday in Scotland.
SFRS incident commander, deputy assistant chief officer Stuart Stevens, said: “We have worked through the night in challenging conditions to contain this fire and prevent further spread within the building.
“Through effective planning, we have now surrounded the fire and we are working to extinguish the flames.
“However this remains a large and complex incident and we will remain in attendance for some time.
“Our advice remains that members of the public should avoid the area to allow access for emergency service vehicles.”