A federal judge in Florida last month reinstated a lawsuit filed by a grandmother who was booked into jail as a man, resulting in her spending nearly 10 hours in a holding cell with leering male inmates.

The ruling allows Fior Pichardo de Veloz to pursue a trial against Dr. Fredesvindo Rodriguez-Garcia and nurse Fatu Kamara Harris, of the Miami-Dade Corrections Department, the Miami Herald reported.

“Every reasonable prison officer and medical personnel would have known that wrongfully misclassifying a biological female as a male inmate and placing that female in the male population of a detention facility was unlawful,” Judge Frank Hull wrote in the unanimous opinion released Nov. 21.

“Every reasonable prison officer and medical personnel would have known that wrongfully misclassifying a biological female as a male inmate and placing that female in the male population of a detention facility was unlawful.” — Judge Frank Hull

Harris was “exposed to consistent and repeated information that Mrs. Pichardo was a woman” and “stubbornly refused” to confirm Pichardo’s gender, and the doctor “knew that sending a woman to an all-male prison would pose a risk of serious harm to her safety, however, he took no steps to verify Mrs. Pichardo’s sex before re-classifying her as male,” the court said.

Pichardo, 55, an attorney and elected official in the Dominican Republic, was arrested in November 2013 at Miami International Airport on suspicion of an old drug case.

During the booking process at Turner Guilford Knight Correctional Center, Pichardo was asked her whether she was a man because her file noted that she was taking hormone pills. She was under hormone replacement therapy at the time to help with menopause symptoms, the court said.

The doctor never had Pichardo undress, never conducted a physical examination and never asked about her gender or why she was on the pills before classifying her as a man, according to the paper.

The nurse also claimed Pichardo was a man, the paper said.

The nurse added a note to Pichardo’s file: ”Transgender, male parts, female tendencies."

Some corrections officers relayed their concerns about placing Pichardo in a cell with men, but were brushed off, the paper reported.

One jailer told the grandmother, "You are a woman. Good luck if you're alive tomorrow," according to the court opinion.

Pichardo was housed with about 40 men who laughed at her and yelled out “Mami! Mami!”

She was so afraid to use the toilet, “she urinated on herself instead,” the court opinion said.

Male jailers laughed at her and the mistake wasn’t realized until Pichardo’s family came to the jail and she was taken out of the cell.