A voyeur who planned to film up women's skirts was injured when the spy camera hidden in his shoe exploded, say police.
The 32 year-old man suffered burns to his foot when the device's battery blew up before he was able to capture any video.
He then limped into his local police station in the US state of Wisconsin to confess.
The real-life example of instant karma could have left the suspect facing a maximum sentence of three-and-a-half years in prison and a $10,000 (£7,600) fine.
Instead officers decided to let him off with a warning because he had not actually obtained any illicit footage.
Madison police chief Mike Koval revealed the incident on his blog but referred to the man only as "HM".
"The subject reported he had purchased a shoe camera that he intended to use to take 'upskirt' videos of females," wrote Mr Koval.
"The camera battery had exploded prior to obtaining any video, injuring the subject's foot."
Officers told the Wisconsin State Journal that the man first revealed what had happened to his mentor, a clergyman, after receiving medical treatment.
He was advised to go to police and was accompanied to the West District station at 5.24pm on 26 June.
"The subject was counselled on his actions and released from the scene as no illicit video had been taken," wrote Mr Koval.
Attempts to bring in a specific law in England and Wales were stalled by Conservative MP Sir Christopher earlier this month but Theresa May is set to introduce new legislation by the end of the year.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies