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.

One man messaged him.

"I believe he messaged me, 'Are you down to have some fun tonight?' and I decided to take advantage of it," Ethan said.

Congratulations to Officers Davies & Lewis, who graduated today from Inner Perspectives, a leadership program for #lawenforcement. They put a great deal of time and effort into the program and can now reap its rewards. 🎓👮🏻‍♂️👮🏼‍♂️ pic.twitter.com/7J8IKhtD8k — San Mateo PD (@SanMateoPD) May 3, 2019

He then texted the man on a different app that he was 16 years old and asked if that would bother him. Police said screengrabs of the conversation show it did not bother the suspect.

"We started texting on there, and it got a lot more explicit," Ethan said.

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.

"I was just looking to get someone," Ethan said. "He just happened to be a cop."

Davies has been placed on paid administrative leave, according to the San Mateo Police Department. San Mateo police Chief Susan Manheimer released a statement about the arrest last week:

"This alleged conduct, if true, is in no way a reflection of all that we stand for as a Department, and is an affront to the tenets of our department and our profession as a whole. As San Mateo police officers, we have sworn an oath to serve and protect our communities. I can assure you that we remain steadfast to this commitment to serving our community with “Professionalism, Integrity, and Excellence."

Davies faces a charge of contacting a minor to commit a felony, police said.

Anyone with information about the incident or any similar incidents should contact Detective Michael O'Grady at 408-537-1397. Those wishing to remain anonymous may call the Crime Stoppers Tip Line, 408-947-STOP (7867).