A 10-year-old girl trapped a paedophile by secretly using her hand-held Nintendo computer game console to take a picture of him abusing her.
John Fisher, 46, has been jailed for three and a half years.
Ipswich Crown Court heard how he had first touched the little girl - whose identity has not been revealed - when she was nine. Sadly, although she told her mother what Fisher, a family friend, had done, nothing was done about it.
Prosecutor Robert Sadd said she was playing on her Nintendo DSi while alone 22 months later when Fisher came up to her and indecently assaulted her.
Mr Sadd said she 'had the presence of mind' to photograph him with the £80 games console which was still in her hands.
Her abuser did did not realise that his young victim had taken the photograph with her Nintendo DSi while he was indecently assaulting her.
The girl then showed the photograph to her mother as evidence of what had happened and the mother immediately contacted police.
Fisher who is married with a daughter and grandchildren at first denied assaulting the girl.
But he admitted it when police confronted with the photograph.
Detectives were able to prove the image was of him as it showed features of his hand and items of his clothing even though it did not reveal his face.
Nintendo DSi consoles which have been available since 2009 feature two digital cameras which are usually used by young players to take photographs of their friends.
Fisher of Lowestoft, Suffolk, admitted two offences of assault by penetration in January 2010 and November 2011.
Judge John Holt told him the offences were very serious and he did not think it appropriate for him to receive treatment in the community.
Fisher was also put on the sex offenders' register indefinitely and given a sexual offences prevention order, restricting his contact with children under the age of 16 for the next 10 years.
Steven Dyble, defending Fisher, described him as "borderline learning disabled".
He added that the offences were serious, but no physical harm was caused to the child.
Mr Dyble said Fisher had pleaded guilty at the earliest opportunity and had not committed similar offences in the past or served a prison sentence before.
He said Fisher had admitted he was attracted to girls in their early teens and would benefit from a treatment programme aimed at addressing his offending behaviour.
Detective Constable Annabelle Bunn of Suffolk Police praised the girl for her courage after the hearing.
She said: "Her quick thinking in using her games console to take a photograph of him touching her provided indisputable proof of what had happened and she was brave enough to come forward and report the incident and give us a full and accurate account of what had gone on.
"Although Fisher initially denied assaulting her, when confronted with the image he had no choice but to concede he had done exactly as she had reported.
"It is important that victims of sexual abuse feel they can come forward, regardless of their age or how long ago they were abused, and we will continue to work with those who find the courage to come forward to try and bring offenders like Fisher to justice.
"When serious allegations are made by a child about close family or friends, people may find it difficult to comprehend what has gone on or think they don't have the proof, but all concerns should be reported automatically to the authorities."