A college student wanted to take down potential predators on Tinder. So, he posed as a teen girl using Snapchat's new gender filter — and ended up catching a cop allegedly looking to hook up with a minor.

Ethan, a 20-year-old from the San Francisco Bay Area, used the Snapchat filter to pose as a 16-year-old girl named Esther. He created a Tinder account as a 19-year-old girl, but said he was communicating with San Mateo Officer Robert Davies as a 16-year-old, police say.

He used Snapchat’s “gender switch” filter to pose as a 16-year-old girl online, and take down a police officer allegedly looking to hook up. He tipped off the PD, and the officer was arrested.

Our exclusive interview with the man, and why he did it, at 11 on @nbcbayarea pic.twitter.com/VaGtg14uLL — Ian Cull (@NBCian) June 11, 2019

San Jose police arrested the 40-year-old San Mateo officer last Thursday for allegedly communicating with a minor with the intention of engaging in sexual activity. He was booked into Santa Clara County Jail.

Get Breaking News Delivered to Your Inbox

Police say the two initially spoke on Tinder in early May, before switching to Kik Messenger and later, Snapchat. According to police, Davies acknowledged that he was speaking to a minor, continuing to chat on Snapchat about engaging in sexual activity.

San Jose Police Department arrested Robert Davies for contacting a minor to commit a felony. San Jose Police Department

Ethan, described as a "concerned citizen," tipped police off to Davies, who was arrested last week after a lengthy investigation. Police say that Ethan was able to research Davies after their conversations and determine his identity.

The San Mateo Police Department said that Davies was off duty in another county when the conversations occurred. He is currently on paid administrative leave.

"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," San Mateo Police Chief Susan Manheimer said in a statement. "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.'