The decision allows the lawsuit, which alleges Koerner violated Keith's constitutional rights, to move forward in the U.S. District Court for Kansas.

"Mr. Koerner's arguments to the contrary do not carry the day," appellate judges wrote in a 10-page decision.

Anastacio “Ted” Gallardo, the employee who had intercourse with Keith in 2007, was prosecuted by the Shawnee County District Attorney’s Office. He pleaded guilty to unlawful sexual relations and other crimes.

Keith sued Gallardo and supervisory employees. She obtained a default judgment against Gallardo. Chief U.S. District Judge Kathryn Vratil dismissed the lawsuit against the supervisors, except for Koerner.

He was relieved of duties in a scandal over sex between male staff members and female inmates. His employment with the Kansas Department of Corrections ended in 2010.

Tuesday's decision says Keith's lawsuit can proceed because it sufficiently alleges Koerner was aware of "multiple incidents of unlawful sexual conduct" between male staff and inmates and failed to properly investigate allegations of that kind of misconduct.

"It is clearly established that a prison official's deliberate indifference to sexual abuse by prison employees violates" the constitutional protection against cruel and unusual punishment, the judges wrote, citing court precedents.

Vratil had concluded Koerner, as the person responsible for TCF, could be liable.

Assistant attorney general John Wesley Smith contended Vratil erred by not dismissing the lawsuit because sexual misconduct was investigated and discipline was meted out during Koerner's tenure.

Smith argued that although Koerner may have had knowledge of other incidents of sexual misconduct, he had no indication of potential harm to Keith specifically.

The appellate judges left for a jury in Vratil's court to decide whether Koerner did violate Keith's rights.

The lawsuit claims Koerner violated her constitutional rights by creating and allowing a “culture of sexual misconduct.”

Paul Hughes, attorney for Keith, cited a state audit’s conclusion that Koerner “didn’t make the changes necessary” to remedy conditions that made inmates vulnerable to staff misconduct.

There were at least 54 reports of alleged sexual misconduct at the prison between 2005 and 2009 that Hughes called to the judges' attention.