Primary school head took indecent pictures of girls.
Damien Peter Flynn took pictures of the girl and another youngster playing in a car near his home without their knowledge, while he was the headteacher of a Roman Catholic primary school, Birmingham Crown Court was told.
The 50-year-old, who has since resigned from St Peter and St Paul Junior and Infant School, in Erdington, Birmingham, was put on probation for two years, ordered to register as a sex offender and pay pounds 525 costs.
Judge David Matthews said Flynn, who was described by his counsel as "odd, but not wicked", had committed a "serious invasion" of the girls' privacy.
The judge told Flynn: "It has become clear to me from the reports I have seen that you have a sexual attraction to young girls, which needs to be addressed.
"If there had been any question of any child being abused, of photographs being distributed or if you had any previous convictions for any similar offence I would have sent you to prison."
The judge added that Flynn, who was headmaster of the school for 16 years, had suffered considerably by losing his good character and his job as a "dedicated" schoolmaster.
Ms Janet Newman, prosecuting, said Flynn, who admitted two counts of taking indecent photographs, was arrested at his West Midlands home in December, last year, after a photo-processing worker tipped off officers.
The headmaster was arrested at his school and his home was searched, unearthing several hundred images of fully-clothed children, all apparently taken without the youngsters' knowledge.
Three of the photographs, of a ten-year-old's groin area, were taken about two years ago through a gap in a garden fence as the girl relaxed in her family's lounge, the court heard.
Four other pictures, of a girl aged about ten who has not been traced, were taken from a window at Flynn's home and also showed the youngster's groin area as she enjoyed a playful fight with her brother in a parked car.
Mr Denis Desmond, defending, said Flynn had taken the images through the fence after consuming "rather too much alcohol" and emphasised that both youngsters involved had been wearing clothes.
Mr Desmond conceded that it was "worrying" that a headmaster should have inclinations towards young girls, but said the defendant was "filled with remorse" and had acknowledged he had a problem.
"He might be odd, but I submit that he's not wicked," Mr Desmond said, adding that there had been no attempt to let the children know they were being photographed or to corrupt them.
After the hearing Det Sgt Paul Tonks, of West Midlands Police, said: "We seized several hundred photographs, all taken covertly and mainly of young girls' groins."
The charges Flynn admitted related to just seven of the photographs.
The court ordered that Flynn's home address was not published.