The caller asked staff at St Mary's Primary in Paisley, Renfrewshire, to tell the youngster not to take the bus home as he would collect her.
Instead they contacted the pupil's parent who confirmed that they had made no such call.
Police were called and the school has written to parents, alerting them to the incident.
Pupils have been reminded about getting to and from school safely and not giving out personal details online.
A Police Scotland spokeswoman said: "Inquiries are continuing."
A Renfrewshire Council spokesman said: "Prompt action by staff at the school has averted a potentially very serious child protection incident.
"Pupils at the school are now being reminded not to put any personal details on social networking sites."