The universe has found its own way to punish a man who bought a “shoe camera” for taking photographs and video up women’s skirts.

The camera’s battery apparently exploded during a trial run at home, injuring the man’s foot, according to police in the American state of Wisconsin.

Officers said the 32-year-old handed himself in but will not be prosecuted as he did not capture any offending images.

The painful episode was revealed by Mike Koval, the chief of police in the state’s capital Madison, on his blog.

“He said he had purchased a shoe camera that he intended to use to take upskirt videos of females, but the camera battery exploded prior to obtaining any video,” he said.

Officer David Dexheimer took up the story.