A San Francisco Bay Area college student used a Snapchat filter to pretend he was an underage girl online and take down a San Mateo police officer allegedly looking to hook up on Tinder.

Ethan, 20, told police he had a female friend who had been molested as a child and went online to create an undercover profile to identify possible pedophiles.

The student, who did not provide his last name because he fears retaliation, used Snapchat’s gender-switch filter to take a picture of himself and posed as a woman named “Esther” on Tinder.

The person on the other line, investigators said, was Robert Davies, a San Mateo police officer. He was arrested last week by San Jose police on suspicion of discussing sexual activity with a minor on social media.Davies also was recently recognized for his police leadership.Ethan said Davies and him exchanged messages for over 12 hours. He sent screengrabs of their conversations to Crime Stoppers.