Hugging can create a hostile work environment.

In a decision Thursday, a three-judge panel of the U.S. 9th Circuit Court of Appeals revived a sexual harassment lawsuit against Yolo County Sheriff Edward G. Prieto, who was charged with hugging a female correctional officer more than 100 times over a 12-year period.

Prieto argued he also hugged male employees. If he hugged women more, his lawyers said, it was because of “genuine but innocuous differences in the ways men and women routinely interact with members of the same sex and the opposite sex.”

But the 9th Circuit said hugging can create an abusive work environment if it is both unwelcome and pervasive.

Victoria Zetwick, the correctional officer who sued the sheriff, also charged that Prieto once kissed her when congratulating her on her marriage to another deputy.

She said she saw Prieto hug dozens of other female employees during her 12 years in the department but give male employees mere handshakes.

In defending against the suit, Yolo County said Zetwick admitted that she had hugged male co-workers occasionally.

The county also pointed to a declaration in which Zetwick described Prieto’s hugs as brief. He made no sexual comments or touched her otherwise, the county said.

Still, the court said, Zetwick argued his hugs were “chest to breast.”

A federal district judge dismissed Zetwick’s lawsuit in 2014. But the 9th Circuit said she had offered enough evidence to possibly persuade a reasonable juror that she had suffered from sexual harassment.

“She submitted evidence from which a reasonable juror could conclude that, even if Prieto also hugged men on occasion, there were `qualitative and quantitative differences’ in the hugging conduct toward the two genders,” wrote District Court Judge Mark W. Bennett, a senior judge from Iowa who was filling in on the 9th Circuit.

She said in her suit that Prieto’s conduct made it difficult for her to concentrate. She was constantly stressed and anxious, she said, and she had to resort to taking medication for sleep.

Prieto’s hugs, she argued, had sexual overtones.

A spokesman for the sheriff’s office said he could not comment on the decision while the litigation was pending.