JEFFERSON COUNTY, Colo. (CBS4) – A former Denver police officer has been arrested for attempting to have sex with someone he believed was a minor.

Investigators with the Jefferson County District Attorney’s office say Joseph Ellsworth, 58, tried coaxing a minor into sex via a smartphone app that’s popular with teens. He’s charged with Internet luring and attempted sex assault on a child.

READ MORE: Second Body Found In Poudre Canyon After Devastating Flood & Mudslide

During an undercover sting, an investigator with the DA’s office posed as a female child.

“Almost immediately (the investigator was) contacted by (the suspect) who indicated, ‘Do you like rich doctors?’ And that started the conversation,” Jefferson County District Attorney Peter Weir said.

An arrest affidavit says Ellsworth repeatedly asked the investigator to confirm if she was 15.

He wrote: “u have to tell me ur realyyy 15.”

The investigator told him she wasn’t. Ellsworth told her that could land him in trouble.

READ MORE: Colorado Boy Suffers Life-Threatening Injuries After Falling From 2nd Floor Of Town Center Of Aurora

“Clearly Mr. Ellsworth had an understanding of the law,” Weir said, “and he had an understanding of what it took to circumvent the law.”

Still, Ellsworth persisted, the DA’s office said: “I’d still like to get together,” he wrote, according to investigators. She agreed and they arranged a place to meet, and Ellsworth said he would bring protection for sex. He drove from his Colorado Springs home to Littleton to meet.

He told her: “Let’s keep this between us,” according to the affidavit.

Ellsworth was a Denver police officer from 1984 to 1996, when he was terminated after being convicted for drunk driving. Four years later, he attempted to have sex with a minor in Tulsa, Okla., and was labeled a sex offender.

Mike Harris, an investigator with the county’s child sex offender unit, poses as teens to help nab people looking to contact children.

MORE NEWS: New Wildfire Shuts Down Part Of I-70 Between Eagle & Gypsum

“I use all their slang and it’s ridiculous, but that’s how good you have to be to portray yourself as an underage teen,” Harris said.