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 school 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 school and, when they looked behind, they saw he was following them.
A teacher in the school was alerted about 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.