The incident has generated a mixture of shock and amusement in France. The boy spent 10 minutes with a bemused gendarmerie before being rescued by a neighbour.
His parents have lodged a formal complaint, saying that he now suffers from nightmares. The ministry of education described the incident as "regrettable".
But the headmistress at a village school in the Ardennes in northern France has been commended by her bosses.
The incident arises from a local dispute about how parents should pay for school meals. The mayor of Nouvion-sur-Meuse abolished the system that allowed parents to buy occasional tickets to send their children to the school canteen.
The system was too complicated to administer, he decided. In future, parents must pay in advance for all meals or none. Andre's parents were part of a group campaigning against the change.
Andre and his 11-year-old brother turned up at the canteen with a cheque to pay for that day's meals and a note from their parents.
The headmistress refused to let them eat and said that she had no one available to look after them.
She sent the older boy home but took the five-year-old to the gendarmerie "for safe-keeping".
The head of the local education district, Andre Lespagnol, originally described the headmistress's action as "unacceptable." Having heard her side of the story, he said that she had no other choice.
"The regulations do not foresee this kind of situation," he said. He admitted, however, that the incident had given a "regrettable image" to the school.
Andre's parents have moved the boy, and his brother, to another school.Reuse content