FAIRFIELD — Charles Lawrence III wanted to teach the “13-year-old boy” he contacted over the Internet the ways of sexual desire.

But the boy turned out to be a police decoy, and now the 60-year-old Fairfield commercial real estate agent is not only facing up to three years in prison, but exposure on a national television show.

Lawrence was one of 10 men snagged in a sting last October at a local house. The sting, set up by TV personality Chris Hansen, Fairfield police and State’s Attorney John Smriga, arranged for male and female Fairfield University theater students to pose as young teens when contacted by the adult suspects. When the men showed up at the house, allegedly to have sex with the teenagers, they were arrested, and the incident was video recorded for a later television program.

Dressed in a blue suit, Lawrence stood before Judge Robert Devlin at state Superior Court in Bridgeport on Thursday morning and pleaded guilty under the Alford Doctrine to second-degree attempted sexual assault, attempted risk of injury to a minor and enticing a minor to have an obscene performance.

The judge told Lawrence he would impose a prison term of not more than three years, but not less than nine months, when Lawrence is sentenced Sept. 2.

A plea under the Alford Doctrine means Lawrence did not admit to all the facts of the case, but conceded the state has sufficient evidence to convict him of the crime. The judge then found him guilty.

Lawrence and his lawyer, Edward Gavin, declined comment as they left the courthouse.

Assistant State’s Attorney Marc Durso told the judge beginning in September, Lawrence began communicating through the internet site Grindr with who he thought was a 13-year-old boy.

Lawrence inquired about the boy’s sexual desires and told him he could be is teacher, the prosecutor said. On Oct. 3, Durso said, Lawrence arrived at the decoy house and was subsequently arrested.

Police said they found a bottle of lubricant and a bottle of nail polish remover in Lawrernce’s possession, the prosecutor told the judge.