A registered sex offender who slid his iPhone under a toilet cubicle to spy on a teenage girl was arrested after being tracked down with facial recognition technology.
Dorniel Nica, 28, filmed his victim in the public toilets of Warrington's Golden Square Shopping Centre on 2 October.
The girl, who headed towards the lavatories after feeling sick, said she saw a hand holding a black iPhone coming from underneath the partition of the neighbouring cubicle.
She believed the phone was recording and that there was a man in the cubicle next to her performing a sex act, Warrington Magistrates' Court heard.
As this unfolded, the girl's friend had gone to get her a drink of water, and when she returned they both left the toilet area not seeing the man.
They approached two police officers and after checking the shopping centre's CCTV saw a man entering the female toilets at 5.12pm and leaving at 5.55pm.
Officers took his image and submitted it through Retrospective Facial Recognition (RFR) software, which returned a match for Nica, from Chester.
Nica was arrested the following morning and had his phone seized by police. He was charged with voyeurism and attempting to observe a person doing a private act.
Police constable Wendy Whitehead said: "If it wasn’t for the bravery of the victim for approaching the first police officers she had seen we may not have been able to achieve the result we have done.
"Thanks to the new technology available to us, we were able to identify Nica quickly and effectively, allowing us to make further enquiries and ascertain his whereabouts.
"This led us to get justice for Nica's victims and put a prolific offender behind bars and off the streets of Cheshire.
"This result reinforces our commitment to tackling violence against women and girls, we will prevent, deter and take action against anyone who preys on women and girls."
Nica was sentenced to 36 weeks in prison. He was also handed two restraining orders against two girls and ordered to pay court costs.