ROME, Ga. — Before she fell on hard times and got into trouble with the law, Ashley Diamond had a wardrobe of wigs named after her favorite divas. “Darling, hand me Aretha” or Mariah or Madonna, she would say to her younger sister when they glammed up to go out on the town.

Ms. Diamond, 36, had lived openly and outspokenly as a transgender woman since adolescence, much of that time defying the norms in this conservative Southern city.

But on the day she arrived at a Georgia prison intake center in 2012, the deliberate defeminizing of Ms. Diamond began. Ordered to strip alongside male inmates, she froze but ultimately removed her long hair and the Hannah Montana pajamas in which she had been taken into custody, she said. She hugged her rounded breasts protectively.

Looking back, she said, it seemed an apt rite of initiation into what became three years of degrading and abusive treatment, starting with the state’s denial of the hormones she says she had taken for 17 years. But on Friday, Ms. Diamond and, through her, all transgender inmates won the unexpected support of the Justice Department, which intervened on her behalf in the federal lawsuit she filed against Georgia corrections officials in February.