A Coventry youngster who was grabbed by a stranger turned detective when he spotted his attacker a few weeks later.
The 12-year-old saw his assailant chatting to a barber in a shop doorway.
The quick-thinking lad asked the barber who the man was, and then told his father, who contacted police.
As a result of his actions, 54-year-old Paul Kemp, of Spon End, Coventry, appeared before the crown court in Leamington where he pleaded guilty to sexual assault.
He was given a three-year community sentence, and was ordered to take part in a sex offenders’ group work programme and register as a sex offender for five years.
Prosecutor Richard Franck said the boy had walked down an alleyway on his way to Morrisons in Holyhead Road to get some shopping for his mother, last June.
He saw Kemp staring at him but carried on walking. Kemp followed and grabbed him by his shoulder, telling him to “pull his trousers down”.
Kemp left the scene when two older boys appeared in the entrance to the alleyway, and the incident was reported to police after the boy got home.
About three weeks later the youngster was in Spon End when he saw a barber in the doorway of his shop talking to a man he recognised as his assailant.
He waited until Kemp had gone and then asked the barber the name of the man he had been talking to and where he lived.
That was passed to the police, but when he was arrested Kemp denied having been in the area of Morrisons on the day in question, claiming he was in the city centre at the time, added Mr Franck.
Peter Cooper, defending, pointed out that although Kemp had touched the boy briefly on the shoulder, he had not actually touched him indecently. He added: “It is an episode of which he is deeply ashamed. We have a man of 54 who has never been in trouble before.”
Mr Cooper said a psychiatric report explained why Kemp, who had been taken off medication at the time, had only a clouded recollection of what had happened.
Sentencing Kemp, Judge Michael Cullum told him: “Although you touched that lad only on the shoulder, the fact that you made an indecent suggestion at the time amounts to a sexual assault.
“The effect on that young lad is one that has been fairly dramatic; it has taken away his confidence at a developing time in his life.
“But I accept you acted in a way that was totally out of character at a time when you were not taking your medication and your mental health had deteriorated.”