New York City police officers forced a 27-year-old woman to give birth while shackled to a hospital bed, in violation of state law, according to a lawsuit filed Thursday.

The woman, who asked to be identified in the complaint only as Jane Doe, was arrested on Feb. 7, 2018, on a misdemeanor charge related to a family dispute. She was nine months pregnant. Within hours, she went into labor inside a police holding cell.

NYPD officers transported her to Montefiore Medical Center in handcuffs. When she arrived, an officer put heavy shackles on her feet, chaining her ankles together.

Doctors who assisted in the woman’s labor urged NYPD officers to remove the shackles for the safety of the mother and baby, the complaint states, and informed them that the practice was in violation of state law.

Under New York legislation passed in 2015, it is illegal to shackle an incarcerated woman at any stage of her pregnancy or in the 8 weeks following delivery.

The officers refused, stating that they were following procedure from the NYPD patrol guide, which they believed superseded state law, according to the complaint.

Ten minutes before the woman delivered her daughter, officers finally unshackled her ankles and one of her wrists. She gave birth with one wrist chained to the hospital bed.

Shortly after delivery, her ankles were shackled again, the suit states, and the woman struggled to feed her baby with only one arm free.

She gave birth in chains, in a way that made her feel like a dangerous criminal. Ashok Chandran, an attorney for the woman

The woman is seeking damages for a violation of her civil rights, as well as changes to NYPD policies to ensure pregnant women are not shackled in the future.

“She gave birth in chains, in a way that made her feel like a dangerous criminal,” Ashok Chandran, one of her attorneys, told HuffPost. “She continues to have nightmares. She remembers the fear and anxiety she felt when doctors were saying this was a serious risk to her and her child.”

Medical experts are in agreement that shackling pregnant women poses serious dangers to both the mother and child. Shackles make it difficult for women to shift into different positions while in labor, and can impede the ability of medical staff to do their job. The American College of Obstetricians and Gynecologists says the use of restraints on pregnant incarcerated women may “not only compromise health care but is demeaning and rarely necessary.”

Twenty-two states and the District of Columbia have passed legislation to ban or restrict the use of shackles on incarcerated women. A criminal justice reform bill backed by President Donald Trump, the First Step Act, would ban the shackling of women at federal facilities during pregnancy, labor and postpartum recovery.

The woman had planned to deliver her baby at the Bronx Lebanon Hospital under her obstetrician’s care, with her partner by her side, Chandran added.

“She was denied both those things,” he said.

He said his client brought the suit because she wanted to make sure that the NYPD follows state law, and that no other women has to experience the trauma that she did.

The NYPD declined to comment on pending litigation. In a statement, the New York City Law Department, which represents the city and its agencies, said it was examining the allegations “very carefully.”

Shackling is a dehumanizing, cruel and pointless practice that has no place in New York City in 2018. Jane Doe's lawsuit

“This is a civil rights case about the egregious failure of the NYPD to protect the health, safety and dignity of a woman at one of the most important and vulnerable moments of her life,” the suit reads. “Shackling is a dehumanizing, cruel and pointless practice that has no place in New York City in 2018.”

In an affidavit filed with the Federal District Court in Manhattan, the woman explained that she wants to remain anonymous because the experience humiliated her.

She said she hadn’t told many friends or family members about what happened.

“I’m embarrassed, and don’t want people to think about me like that,” she wrote.

She also feared that she might face retaliation from the NYPD officers if she was identified.

“I don’t want my name to be forever associated with this traumatic event,” she wrote. “I want to shield my child from this for as long as possible.”