In 2006, Vermont achieved a dubious distinction: It became the last state in the country to make it illegal for prison guards to have sex with the inmates they supervise.

Just as the law prohibits teachers from having sexual contact with adult students, legislators decided that inside a prison, where power is not evenly distributed, there’s no such thing as “consensual” sex.

Outside advocates and lawmakers who supported the bill made clear that such a law had one primary goal: protecting female inmates from male guards.

But a recent case in Windsor County — one of the apparently few times the law has been invoked in Vermont — has confounded the expectations of the law’s backers and left the prosecutor in a bind.

A female prison guard allegedly had sex with a male inmate. The inmate, authorities said, is the one who appeared to have coercive power over the guard. And, nine months after their encounter, a child was born.

“None of the things I thought about as a legislator when I passed that law applied to this case,” said Windsor County State’s Attorney Michael Kainen, who served in the Vermont House of Representatives from 1999 to 2006.

A police affidavit filed in Windsor Superior Court describes the encounter between Southeast State Correctional Facility guard Leanne Salls and James Ingerson, who is serving a 20- to 30-year sentence for burglarizing a Brattleboro restaurant in 2002.

Salls, who began working at the prison in 2006, was placed on administrative leave in 2011 for alleged “boundary violations,” with Ingerson. Police did not provide details of those alleged violations, but a letter confiscated by prison officials in November 2011 elevated the matter from an internal disciplinary issue to a criminal inquiry.

“Are you happy about the loaf of bread we have in the oven?” Ingerson asked Salls in a written communication obtained by prison superintendent Dave Bovat.

How did he get it? In an apparent attempt to avoid detection by prison officials, who have the right to listen to inmate’s phone calls and read their correspondence, Ingerson allegedly gave the letter to another inmate, who was supposed to mail it to his own wife in Maine. She was going to mail it to Salls, who lives in Hartford.

Instead, Ingerson’s inmate buddy gave the letter to Bovat.

In addition, one of Salls’ fellow guards in the Windsor prison, a woman with whom she had been friends since high school, told police that Salls was indeed pregnant, and had confided that she was having a relationship with Ingerson, according to the affidavit.

Ingerson refused to share any specifics with police, and authorities have still not explained how Salls, who no longer works at the prison, and Ingerson were able to spend time together without getting caught.

But Ingerson repeatedly tried to take responsibility and deflect attention from Salls, now 30.

“Whatever evidence you have, put it on me,” he told police, according to an affidavit. “I did everything. I came on to her.”

Salls gave birth in May 2012.

Days later, another prison guard, Kiki Boyens, heard Ingerson telling fellow inmates that Salls had given birth, and that he was “150 percent sure,” he was the dad.

“We call you dad?” Boyens asked Ingerson.

“Yeah, I’m pretty sure,” Ingerson said, with a big smile on his face, according to the affidavit. “We love each other, and it doesn’t make us bad people.”

In September 2012, a Windsor County judge issued a search warrant to obtain DNA from Ingerson, Salls and the baby. The match was confirmed.

The case was turned over to the Windsor County state’s attorney’s office, where, months later, prosecutors determined the alleged conduct fell under a state law that their office had never before applied: sexual exploitation of an inmate, a felony sex crime that carries a five-year maximum prison sentence.

Rep. Kurt Wright (R-Burlington) was a primary sponsor of a bill that eventually became Vermont law.

In an interview, Wright said he became concerned after lawyers spoke to him about several coercive sexual encounters between guards and inmates. Wright saw the bill as part of a larger public-safety push — he also supported legislation to prohibit relations between teachers and students — and said he had been surprised to learn that the law did not view guard-inmate relations the same way.

The 2006 law passed with little opposition, Wright and Kainen said.

“It seemed like a no-brainer,” Wright said. “You can’t have a teacher ... using their position of power, authority and access to have a sexual relationship. The same thing applies to prison guards. That had to be illegal. I’m glad we joined the rest of the nation, because you can’t have a person with power over another having consensual sex.”

There is no definitive record, but speaking anecdotally, experts said Wright’s law has rarely been invoked in Vermont. Robin Weber, a researcher for the Vermont Center for Justice Research, said that between 2008 and May 2013, only one charge was filed, and it was dismissed.

That apparently doesn’t include one pending against a former DOC nurse who allegedly touched a female prisoner at the Chittenden Regional Correctional Center in April 2012.

Last month, federal prosecutors in Burlington charged male prison guard Tracy Holliman with having sexual contact with two female prisoners inside the Chittenden Regional Correctional Facility.

Instead of invoking the Vermont law, the U.S. attorney’s office charged Holliman under a 2003 federal law, the Prison Rape Elimination Act, that made sexual contact between guards and inmates illegal. U.S. Attorney Tristram Coffin said the Holliman case was the first time his office has prosecuted anyone under the federal law.

Why was that an option, given that there are no federal prisons in Vermont? Because the federal law applies to state prisons in which the U.S. government holds inmates, and Vermont Department of Corrections facilities sometimes do.

Vermont Department of Corrections commissioner Andy Pallito confirmed that Salls no longer works for the DOC. He said that similar issues between guards and inmates come up about once a year.

“It’s not a high-frequency event, but it does happen,” Pallito said. “It’s a 24-hour job; in the middle of the night, we can’t always be on top of everyone.”

Inmates receive pamphlets when they get to jail that explain the laws, Pallito said, and cameras capture much of what goes on in the DOC’s facilities. But no system can prevent all abuses.

Doug Gibson, spokesman for the Vermont State Employees Association, which represents prison guards, said the organization did not believe the law was causing any undue problems for SEA members.

“It hasn’t raised any alarms on our end,” Gibson said.

Kainen said that, while he was unaware of any other prosecutor invoking the state law, he felt he had a strong case to take to a jury: The DNA evidence alone would make for compelling evidence of guilt.

But that didn’t make him any more comfortable with the idea of throwing Salls in prison — as an inmate this time. Ingerson, 43, remains in custody; the couple’s child is now 1.

“I don’t think, when it was passed, people were thinking of the Leanne Salls and Ingerson situation,” Kainen said of the law. “It seemed clear to me that he pestered and cajoled her into having sex with him. There was nothing coercive [from Salls]. He acknowledged he was the aggressor. It should be prohibited, but in terms of what the sanction should be.”

Even striking a deal in which Salls would plead guilty to sexual exploitation of an inmate, but not receive any prison time, seemed problematic, Kainen said.

Salls, who had no prior record, would have been a registered sex offender, triggering legal restrictions — she would have trouble visiting daycare or school, for example — and societal pressures: Sex offenders often struggle to find landlords who will rent to them and employers who will take them on.

“The collateral consequences of sex offenses now, in terms of being on the registry and the places you can’t go, it would have been tough to be a single mom,” Kainen said.

Last month, Kainen dropped the felony charge and allowed Salls to plead guilty to a misdemeanor charge of prohibited acts, which is not a sex offense. She received a one-year deferred sentence — she’ll only face prison time if she commits a new offense — and was ordered to undergo mental-health counseling.

Through her attorney, Liz Kruska, Salls declined to comment for this story.

When briefed on the facts of the case, Wright said that Kainen did the right thing in dropping the charge that he helped put on the books.

“I’m glad they can use discretion in these cases,” Wright said. “The case in Windsor is the exception, I’m sure.”

Kainen stressed that his decision had nothing to do with the gender of the guard and inmate, but rather the unusual circumstances surrounding the incident.

“I wouldn’t say any time it’s a female guard and a male inmate I would do a one-year deferred,” Kainen said. “I’m not setting a precedent.”