A transgender inmate who says she was called "it" and "some kind of animal" by guards who watched her shower has won a legal victory that forces the Maryland prison system to better train for how to treat transgender people, advocates say.

Neon Brown, who goes by Sandy, said in a grievance that she was sent to the state prison at Patuxent in February 2014 for a psychological screening. Brown said she was placed in solitary confinement, and kept there for 66 days despite a directive from the jail warden that staff shouldn't segregate her from the rest of the population. During that time, she was routinely harassed by guards who made fun of her while she showered, including one who told her to commit suicide, Brown said in the complaint.

"She told me I should kill myself, and that I'm not a woman, that I'll never be her," Brown said of a corrections officer who regularly harassed her.

Administrative Law Judge Denise Oakes Shaffer ruled in August that Brown's treatment violated the federal Prison Rape Elimination Act, saying the prison "failed to train all employees in how to effectively and professionally communicate with transgender inmates."

Advocates say the complaint and several audits of state prisons in the past year suggest a fundamental lack of training when it comes to how guards handle transgender prisoners, and come as transgender issues have become a focal point in the national conversation about gender identity and gay rights.

"She told me I should kill myself, and that I'm not a woman, that I'll never be her"

— Neon Brown

But Gerard Shields, a spokesman for the Department of Public Safety and Correctional Services, said there has been a "total shift in agency thinking" since Brown's complaint was filed. He said the state also has since developed policies for handling transgender inmates.

In her ruling, Shaffer said the corrections officers "created a hostile environment" that began shortly after Brown arrived and persisted until she was moved to another facility. Furthermore, Patuxent had no policies in place for how to treat transgender inmates, in violation of the federal law, Shaffer wrote in the ruling.

"The majority of Patuxent's witnesses specifically testified that they never had any training with how to work with transgender inmates and further testified that Patuxent did not have any policies in place to provide such guidance," Shaffer wrote, adding that the prison's security chief did not know the federal law had specific requirements regarding transgender inmates.

Patuxent is not alone, according to audit reports of six state-run jails conducted in November of 2014 and obtained by The Associated Press. All six were checked for their compliance with the federal law, and four of them had no policy for how to handle or strip-search transgender inmates. At those facilities, staff told the auditors they did not know how to properly search transgender inmates.

Shields would not comment on the specifics of Brown's case. But he said agency chief Stephen T. Moyer issued a directive in April outlining a policy in which transgender inmates choose whether they are strip-searched by a male or female guard. Shields added that the policy explicitly prohibits searches "for the purpose of determining one's genitalia."

Before the directive was issued, each institution was responsible for developing and implementing its own standards for searching transgender inmates, Shields said. The audits show most institutions did not do so.

The directive does not deal with housing transgender inmates or training for guards, Shields said. However, the state has issued several directives aimed at improving investigative techniques and the administrative handling of "vulnerable inmates," he said. All guards are trained on the federal law, known as PREA, during academy classes, and each prison has a PREA coordinator on site.

The state does not track of the number of transgender prisoners.

Rebecca Earlbeck, an attorney at FreeState Legal Project, a civil legal aid organization, called the ruling "a victory for the rights of incarcerated transgender people."

"This ruling forces the entire state corrections system to adopt a clear policy for the treatment of transgender inmates regarding searches, housing and interaction with transgender inmates," Earlbeck said. "Just as importantly, the ruling also requires mandatory staff training on these policies."