The Georgia Supreme Court on Monday upheld the law the prohibits the solicitation of sodomy, while reversing a conviction against a former South Georgia police officer of the same crime.

James Edwin Watson, once a member of the Nashville, Ga., police force, challenged the law following his 2011 conviction of soliciting sodomy from a 17-year-old and for violating his oath of office. Watson was sentenced to five years with two years to be served in prison and the balance on probation. The state Supreme Court ruling clears him of all charges.

Watson’s lawyer had argued that the solicitation law criminalizes the mere discussion of acts of sodomy. Watson was seeking a sexual encounter that is constitutionally protected by Georgia’s right to privacy. That right was cited in 1998 when the state Supreme Court declared unconstitutional a 165-year-old anti-sodomy law.

On Monday, Justice Carol Hunstein, writing for a unanimous court, said the solicitation of sodomy law is constitutional when applied in accordance with that 1998 decision. That ruling decriminalized private, unforced and non-commercial acts of sexual intimacy between persons legally able to consent, she noted. (In Georgia, the legal age of consent is 16.)

Those limitations are necessary, Hunstein wrote, “to avoid infringing on fundamental privacy rights guaranteed under the Georgia Constitution.”

Watson was convicted for events following a March 1, 2009, incident in which a 17-year-old was at his friend’s house when a dog attack occurred. Police were called and Watson was dispatched to the scene. He later gave the 17-year-old a ride home. During the drive, the teenager later testified, Watson made a lewd gesture while grabbing at his crotch.

Over the following days, Watson sent messages to the teenager, saying he needed to discuss his “payment” for the ride home. In one text message, Watson said the two could get together and “have a little fun if (you) know what I mean.”

The teenager reported the exchange to a high school coach, and school officials then contacted law enforcement. With a GBI agent nearby, the teenager then made two recorded phone calls to Watson who, during the second call, explicitly discussed acts of sodomy. Watson also repeatedly told the teenager that he did not have to do anything he did not want to do, the ruling said.

Jurors, after hearing the recorded phone calls and testimony, found Watson guilty.

In Monday’s opinion, the state Supreme Court found that prosecutors had been able to prove the first prongs of the law — that Watson solicited another individual and asked that person to commit sodomy. But because prosecutors could not show that Watson wanted the act to be done in public, by force, for money or with someone under legal age, the conviction must be overturned, the court said.