A student of Class III, Jayasurya, had been missing since Saturday night and was found last night after his parents filed a police complaint.
Police suspect that while playing with his classmates at Kilavaneri Panchayat Union Middle school near Tirumangalam, 30 km from here, he hid inside the box and accidentally locked it.
Jayasurya might have died of suffocation after his friends left the school thinking that he had gone back home, they said.
The body of the boy was found after the villagers complained to the police of a foul smell coming from the school last night, police said.