The 10-year-old became stuck as he climbed over fibreglass rocks at Juniper Green primary school in Edinburgh.
A crew from Lothian and Borders Fire and Rescue Service arrived shortly before 11am today and used hydraulic spreaders to release him.
Advertisement
Hide AdAdvertisement
Hide AdA spokeswoman for the service said an ambulance had taken the boy to hospital to have his knee X-rayed.