As part of his plea agreement, 34-year-old Tony Fregger agreed to resign from the San Jose police force. He'd been working there for eight years.
Fregger reportedly solicited the teenager on Facebook. She told him that she was 17 years old, but she was really 16.
When the girl told him she was 17, Fregger reportedly sent her a message saying, "You' 17!? Oh man, I thought u were like 21! Lol!"
He continued to communicate with her despite knowing her real age.
"Mr. Fregger was engaged in investigating these crimes against minors and he engaged in one," Deputy District Attorney David Ezgar told CBS in San Francisco.
The girl sent Fregger explicit photos, according to the Mercury News. He asked for the photos knowing she was underage, police say.
Police found the photos on Fregger's computer inside a folder titled with the girl's name, according to CBS.
Ezgar told the newspaper that Fregger knew what he was doing was illegal.
He now faces up to three years in jail and will definitely serve at least six months, according to the Mercury News.