A 27-year-old man from York is being questioned in connection with the incident which happened at Joseph Rowntree School on Haxby Road, New Earswick on Friday afternoon
The girl, 15, was allegedly assaulted as she left school at around 4pm.
The girl was physically uninjured in the attack but was left very shaken up. She was attended to by a paramedic at the school as a precaution.
Inspector Steve Breen of York Safer Neighbourhood Team, said: “This was a frightening incident for the victim and we are providing specialist support to her.
“Reassurance patrols will continue in the area and we are asking pupils, parents and local people to be vigilant and report any suspicious people or activity to the police.
“I also urge anyone who was in the area at the time of the incident and saw the attack happen, saw anyone loitering around the school or can help the police to identify the offender, to come forward as a matter of urgency.”
Anyone who has information that could assist the investigation is asked to call North Yorkshire Police on 101, select option 2 and ask for York CID. Or email [email protected]
If you wish to remain anonymous, you can pass information to Crimestoppers on 0800 555 111.
Please quote reference 12140205848 when passing on information.