A flasher exposed himself to a group of Northamptonshire girls and then followed them into a school, a court heard.
Francois Marius, aged 24, of Fulmar Lane, Wellingborough, walked up to two girls who were walking to a school in the town on November 18 and pulled down his trousers.
John Hallissey, prosecuting, said Marius then started to pleasure himself while he was staring at them.
The two girls then ran away towards the schools and, when they looked behind, they saw he was following them.
A teacher in the school was alerted about the Marius’s behaviour and he was seen walking past the school gates.
He then entered the school grounds and was then stopped by the teacher who told him to leave.
Marius was arrested shortly after by police and pleaded guilty to a charge of indecent exposure.
He will be sentenced at Northampton Crown Court next month.