A former Rikers Island inmate who says three jail guards raped her over the course of several hours has reached a $1.2 million settlement with the city.

The plaintiff, identified in court papers as Jane Doe due to the nature of the allegations, says she was sent to the Rose M. Singer Center on Rikers Island in 2013 on a shoplifting charge — and that began a living hell once correction officers transporting her from the Manhattan criminal court at 100 Centre St. to the jail complex learned that Doe previously worked as a confidential informant for the Department of Homeland Security.

On her first day there, Doe says she was denied food and water and was molested by a doctor at the facility who gave her a gynecological exam against her will. She was then sexually assaulted for hours by three male guards while she was chained to a clogged toilet.

During the attack, Doe says the officers penetrated her with a flashlight, forced her to drink soapy water and pepper sprayed her vagina and anus.

Doe managed to get out of jail six days later with the help of a Homeland Security contact, but in January 2014 she wound up on Rikers again on a credit card fraud charge. Back at Rikers, she says she was subjected to more sexual abuse at the hands of correction officers.

In a December ruling to allow the case to move forward, District Judge Alison Nathan of the Manhattan federal court, who presided over the case, tore into the city, saying that Doe had submitted evidence that “a policy of deliberate indifference to the physical and sexual assault of inmates” at the Rose M. Singer Center and that, if the case had gone to trial, a juror could find that this indifference led to Doe getting sexually assaulted.

According to the ruling, inmates at the Rose M. Singer Center report sexual assaults at twice the national average — and that, according to an expert’s report submitted for the case, corrections officers escape justice for sexual assaults through a “code of silence” between officers.

The Correction Officers Benevolent Association declined to comment on the case.

The victim of the abuse will not be getting rich off the suit, however, as most of the money is going to her lawyers with Doe getting just $250,000.

Attorney Alan Futerfas, who has repped Donald Trump Jr., noted that the case has been pending for almost five years and said that Doe’s attorney fees were actually in excess of $950,000.

“No amount can make someone whole in this situation,” Futerfas said.

As part of the settlement agreement, the city and the other named defendants in the case did not admit to any wrongdoing.

“The safety and security of those entrusted to the care of DOC is a top priority,” a Law Department spokesman said in a written statement. “Based on our evaluation of the circumstances of this case, we have determined that this settlement is in the best interest of all parties. The plaintiff has agreed to withdraw the claims against the defendant officers and settle with the city to end this long standing case.”