A federal jail guard was sentenced Wednesday to seven years in prison after an inmate gave an in-court account of how he sexually assaulted her inside a New York City lockup last year.

"You raped me," the unnamed woman told Rudell Mullings, as she read from a statement in federal court in Brooklyn. "It wasn't consensual sex. It was rape."

The inmate, who was sentenced to 30 years for a homicide, told U.S. District Judge Edward Korman that Mullings had harassed her over the course of several weeks before finally accosting her Feb. 14, 2015 in a hallway of the Manhattan lockup where she was waxing the floor. She described how the hulking man approached her from behind and restrained her. She said he pulled down her pants and raped her.

Court papers say the guard afterward warned the woman not to report him because he would lose his job. They say he also told her there were no security cameras in the hallway that could corroborate her story.

Choking back tears, the inmate said she was already traumatized from being molested by relatives as a child. The assault, she said, "has caused me tremendous pain, humiliation and grief."

After DNA testing confirmed Mullings had sex with the inmate, he initially told investigators it was consensual. But last year, he pleaded guilty to sexually abusing a prisoner, a charge carrying a term of up to three years in prison under sentencing guidelines.

On Wednesday, Mullings told the judge: "I am ashamed of my conduct. I was in a position of authority and I abused that authority." And his lawyer asked for six months of jail time and six months house arrest.

But Korman — after criticizing prosecutors for not making Mullings plead guilty to more serious charges — called the guidelines "ludicrous" given the circumstances of the case. A harsher sentence was needed to send a message to other guards "that this conduct is totally unacceptable and deserves severe punishment," he said.