DES MOINES, Iowa — A former Iowa prison guard whose lawsuit against the state alleged she was sexually harassed after she tried to stop the showing of sexually graphic and violent movies to sex offenders was granted a new trial Wednesday by the Iowa Court of Appeals.

Jury instructions at Kristine Sink’s October 2014 trial were misleading and inaccurately reflected the law, the court said, because they failed to point out that some prisons consider reducing sexual harassment of prison employees as a legitimate prison management policy. That jury had rejected Sink’s claims of harassment, such as inmates threatening to kill her and once being doused with an inmate’s urine.

“We look forward to Kristin Sink having a new trial to correct the mistakes that were made in the first trial,” Sink attorney Emily McCarty said.

A spokesman for the Iowa Attorney General’s office, which represented the state and the Iowa Department of Corrections, did not immediately respond to a message. The state has the option of asking the Iowa Supreme Court to review Wednesday’s ruling.

Sink had alleged that a TV playing sexually explicit and violent content encouraged some inmates to act aggressively toward her, and she turned it off several times between 2003 and 2011. She lobbied prison officials to stop showing such material at the Clinical Care Unit in the Iowa State Penitentiary in Fort Madison, which houses inmates with mental illness and behavioral problems, including sex offenders.

After that action, Sink said in her lawsuit that supervisors allowed inmates and co-workers to harass her for years and belittled her complaints.

When officials finally barred sexually explicit movies in September 2011, inmates allegedly blamed Sink and subjected her to a torrent of insults and death threats. She eventually was moved to an area of the prison away from inmates.

Sink attorney Paige Fiedler said at trial that Sink suffered from major depressive disorder and experienced nightmares and fear similar to post-traumatic stress disorder. Sink had sought $4.5 million for past and present emotional distress.

Assistant Iowa Attorney General Tyler Smith told jurors that officials appropriately dealt with Sink’s complaints and that the difficulties she faced were part of working in a prison. He also said testimony from prison officials and some of Sink’s co-workers showed they were trying to do their jobs in a difficult environment — the state’s maximum security prison.

Smith acknowledged repeatedly at trial that showing the sexually charged movies was a mistake that was corrected.