A 60-year-old Fife flasher was caught exposing himself to schoolgirls after he was recorded from a bus.
William Penman from Dunfermline stood at his window naked from the waist down so that the youngsters would see him.
Dunfermline Sheriff Court heard that one of the pupils, a teenage girl, was upset and frightened by his lurid behaviour.
However, Penman was not only seen by the schoolchildren, he was also filmed by a quick-thinking eyewitness on a mobile phone.
Penman, of Dunfermline, admitted that on January 20 at his home he intentionally exposed his genitals in a sexual manner to a teenage girl with the intention she would see them.
He further admitted standing at a window with his lower clothing removed, exposing his penis.
Depute fiscal Louise Graham told Dunfermline Sheriff Court that the girl travelled on a bus going home past Penman’s home.
She had previously seen Penman standing at his window fully clothed as the bus went past.
But on the day of the incident, the girl saw Penman again at his window but this time with his penis exposed.
The girl said she found his behaviour “upsetting and frightening”.
Another witness on the bus also saw Penman and the incident was recorded on a mobile phone, the depute added.
A teacher was informed and then the police were contacted. Penman was charged and made no comment.
Defence solicitor Russel McPhate said his client had “not committed offences of this nature in the past”.
He added: “At this time he had a number of mental health issues.”
Sheriff Craig McSherry said as a direct alternative to prison he would impose a community payback order with three years’ supervision and 150 hours of unpaid work.
Penman was also put on the sex offenders register.