A Goose Creek man is behind bars after investigators said he was soliciting sex with a minor.

Michael Wayne Manar, 37, was arrested Friday and charged with criminal solicitation of a minor, a felony punishable by up to 10 years in prison, and second-degree attempted criminal sexual conduct with a minor, a felony offense punishable by up to 20 years in prison, according to the S.C. attorney general’s office.

Manar came under investigation after a girl’s stepfather told Berkeley County deputies that a family friend was sending inappropriate messages to his stepdaughter, who is a minor teenager. An undercover detective took over the girl’s account and began texting with Manar. Manar told the undercover detective, thinking she was the girl, that he wanted to meet her to have sex, according to investigators. He was arrested after showing up at the rendezvous point.

Manar was being held in the Berkeley County jail Tuesday on $85,000 bail and an order to have no contact with any children under 17, no access to the Internet or cellphones and to stay at least a half mile from anyplace where children congregate.

Reach Dave Munday at 937-5553 or twitter.com/dmunday.