An undercover operation led to the arrest of a North Charleston man who thought he was going to have sex with a 14-year-old after seeing an ad on Craigslist, according to Charleston police.

Brian Scott Stephenson, 32, of Blue Ridge Trail, was charged with attempted criminal sexual conduct with a minor on Thursday.

Stephenson showed up to a location on Mary Ader Avenue in Charleston expecting to have sex with a teenage girl, according to an arrest affidavit. Stephenson had seen an online advertisement in the Casual Encounters and Personals section of Craigslist.com, authorities said.

The advertisement was placed there by Charleston police in order to catch predators, according to police. Stephenson admitted to a detective that he intended to have sex with the girl, according to the affidavit.