Ellie May went missing at the end of the lunch break after she was accidentally locked out as classmates filed in for lessons.
After discovering the main door was locked she went into the junior school playground next door but still couldn’t find anyone to help her get back inside.
Finally the youngster wandered through the school’s main gates and began walking to her grandmother’s house.
She was spotted by her gran at the end of her road, half a mile from the school, and the youngster was taken back to St Augustine’s Infant and Nursery School in Worksop, Nottinghamshire.
Her father, Ben Williams said: “Ellie was playing out with her friends and she got left behind when they went back inside after lunch.
“She tried to get in and, when she discovered the door was locked, she decided to look for someone and went into the junior playground, but that was deserted as well.
“Eventually the only thing she could think to do was to go to her nan’s house because that is nearby. Luckily my mum had just set off to go to the gym and spotted Ellie at the end of the road.
“Just five minutes later and my mum would have already left and I hate to think where Ellie would have gone. She would have had to cross busy roads - it doesn’t bear thinking about.
“The school has apologised and said they have spoken to pupils, tightened the access between playgrounds and are monitoring the gates. But it doesn’t change the fact that she could have been run over or abducted.”
Catherine Thornton, headteacher at the school, said: “We understand the distress caused to Mr Williams by the incident and want to reassure him that we are taking the matter extremely seriously.
“The safety and wellbeing of all our pupils is our top priority and we aim to keep the children safe within the premises.”