Fire crews remained at the scene on Friday morning after a blaze tore through a high school.
Thick black smoke began billowing from Peebles High School, in the Scottish Borders, around lunchtime on Thursday.
Pupils and staff were all evacuated safely, but the extent of the damage to the school is not yet known and it will remain closed until at least Monday.
At its peak, 70 firefighters were battling the flames, with three engines still on the site on Friday morning.
Incident Commander Stephen Gourlay said: “This was undoubtedly a challenging incident – and indeed one of the most complex building fires I have ever attended.
“I would like to thank our firefighters for working through the night to contain and extinguish this fire, and prevent further spread within the school complex.”
Tracey Logan, chief executive of Scottish Borders Council, praised the response from fire crews and the local community.
She said: “Fire crews have remained on site at Peebles High School overnight and this morning and I would firstly like to pay tribute to them for their tireless efforts.
“I would also like to praise the staff and pupils for the way in which they dealt with the incident yesterday and the prompt evacuation of the school.
“The community of Peebles responded quickly too, and I’d like to thank all those businesses and residents who offered and provided their support to the school and to the emergency services. That support is greatly appreciated.”
Ms Logan said plans to pupils to keep attended classes would be finalised during the weekend and shared with parents.
She said: “At this time this remains a Scottish Fire and Rescue Service-led incident and we continue to work closely with them and Police Scotland. It is not appropriate to speculate on the cause of the fire.
“Until the fire service has completed its work and the necessary investigations are carried out access to the site will be restricted.
“Once the school is handed back to the council we will do our best to quickly assess the damage, caused not only by the fire but also smoke and water, and look at arrangements for the coming days and to return belongings to pupils and staff.
“Our priority is maintaining continuity in the education of our young people here in Peebles and we will work throughout the weekend to make plans for next week and beyond and will communicate to parents, pupils and staff through the normal channels and our dedicated webpage www.scotborders.gov.uk/PHSfire.”