A mother had to intervene after a man took hold of her child's wrist outside a primary school.
Avon and Somerset Police said the incident happened at Parkfield Primary School in Taunton, Somerset, at about 15:30 GMT on Thursday.
The man involved is described as black, aged between 40 and 50, 5ft 8ins in height and with short hair. He was wearing grey jeans and had a bicycle.
Police said the child was physically unharmed.
Officers are checking CCTV and making house-to-house enquiries in the area as part of their investigation, the force said.
Sgt Jonathan O'Connor, of the Taunton Neighbourhood Policing Team, said police had been at the school to speak to staff and parents who had concerns over the incident.
He added: "Although this type of incident is incredibly rare, it was understandably upsetting for the victim's family.
"We are taking this very seriously and working hard to identify this man.
"We will continue to carry out reassurance patrols in the area and would urge anyone who has any information to come forward."