The school remains closed today, as officials from Scottish Borders Council are yet to gain entry to assess the damage, which is thought to be extensive.
The Scottish Fire and Rescue Service was first alerted to the incident at 12.57pm on Thursday, November 28.
At its height, up to 70 firefighters were in attendance as they worked to contain the fire.
Currently, three fire appliances remain in attendance alongside several support vehicles as crews continue to monitor and dampen down any remaining hot spots.
There were no reported casualties.
The complex layout of the school, and the fact that the worst of the fire was in the old gym hall in its centre, made it a tough night for the firefighters, who came from all over the region. However, their efforts stopped the fire from taking over connecting parts of the school, although other areas are smoke damaged and scorched in parts.
Incident Commander Stephen Gourlay is the Scottish Fire and Rescue Service’s Local Senior Officer for Midlothian, East Lothian and the Borders.
He 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.
“I would also like to recognise the support of our emergency services colleagues and local authority partners in helping to bring this incident to a safe conclusion.
“The continued support from the community has also been outstanding and we must also thank them for their patience.
“We will remain in attendance for a considerable time yet as we continue to dampen down any remaining hot spots, and to ensure that the scene is as safe as possible before handing it into the care of our local authority partners.”
Some eyewitness reports hinted that the fire may have started in a kiln in an art classroom, but until a full investigation has taken place, that will not be confirmed.
LSO Gourlay added: “A full joint investigation alongside our Police Scotland colleagues will commence in due course, and we will work to establish the full facts and circumstances of the fire.”