A teenager has admitted he started the fire which burned the former Viewforth High School in Kirkcaldy to the ground.
The 17-year-old has admitted a charge of wilful fire-raising.
Fiscal depute Jamie Hilland explained the boy was just 16 when he set fire to paper and a box within the derelict building, causing more than £40,000 worth of damage.
The B-listed school, built in 1860, had been unused since 2015 and was surrounded by wire mesh fencing panels at the time.
Mr Hilland told Kirkcaldy Sheriff Court the teenager and four friends met on the afternoon of August 15 in 2020.
He stayed there for a period, during which the teenager set fire to printer paper which had been found in a cupboard.
After leaving the school, he pointed at the smoke coming from the school.
The 17-year-old, who cannot be named for legal reasons, later admitted to the friends he set fire to a small box inside.
It was reported in court his friends were “concerned” by this.
By 7.25pm, neighbours could smell smoke and called 999
Firefighters from across the Kingdom rushed to the scene and it took until 2pm the following day before the final flames were extinguished.
After the fire had taken effect, the school roof collapsed and locals watched in sadness as the school bell tumbled to the ground.
Police quickly began enquiries and checked domestic CCTV footage at a number of nearby houses.
The boy was quickly identified and traced.
This week, he admitted wilfully setting fire to paper and a box within the school, which thereafter took effect and spread.
Sheriff James Williamson deferred sentence until April 21 for a social work report.
The teenager pled guilty just 24 hours after three men, entirely unconnected, admitted burning down the former Inverkeithing Primary School building less than 20 miles away.