The firefighter dressed up as the comic book superhero Spider-Man in order to coax the boy, who is autistic, from his dangerous perch.
Efforts by the teachers to convince the pupil back inside had failed.
But a remark by his mother about his passion for comic superheroes prompted fireman Somchai Yoosabai to rush back to the station, where he kept a Spider-Man costume in his locker.

The sight of Mr Yoosabai dressed as Spider-Man and holding a glass of juice for him, brought a big smile to the boy's face, and he promptly threw himself into the arms of his "superhero", police said.
Mr Yoosabai normally uses the costume to liven up fire drills in schools.