A New York City woman is suing the police department for allegedly keeping her in shackles "before, during and after her labor and delivery" of her baby daughter.

The experience left the 27-year-old mom, identified only as "Jane Doe," traumatized "with nightmares about being shackled and losing her baby," her Manhattan federal court lawsuit says.

In an affidavit, Doe says she's using a pseudonym in part because "I don't want my child to know about the humiliation I went through during her delivery and birth. I haven't made sense of it myself, and I'm not ready to explain it to my child."

The NYPD's conduct was inhumane — and illegal, her lawyer, Ashok Chandran, told NBC News on Friday.

He said his client, who was 40 weeks pregnant at the time, had been arrested on a warrant for a non-violent misdemeanor and hadn't resisted the officers in any way. New York State law bars pregnant prisoners from being shackled except "in the most extraordinary circumstances."

"The law has been clear for years. Police were told this multiple times by doctors and they didn't seem to care," Chandran said.

Nick Paolucci, a spokesman for the city Law Department, said, “We are examining these allegations very carefully. We will have no further comment before all the facts are in.”

Doe was picked up on a warrant "for a misdemeanor related to a September 2017 family dispute with her ex-partner" while waiting for paperwork in Bronx Family Court on Feb. 7.

The arresting officers handcuffed her, despite being told she was 40 weeks pregnant, the suit says. She was then taken to her local police station, where she was placed in a holding cell. "At no point between 10:40 am and 7:40 pm was Ms. Doe given or offered any food or water," the suit says.

After she said she was having contractions, police brought her to the hospital, again in handcuffs, the suit says.

Once there, medical personnel told the officers "the use of restraints on the very-pregnant Ms. Doe was dangerous to both Ms. Doe and her baby," but the officers refused to remove them, the suit says.

After the labor pains turned out to be a false alarm, police took Doe back to the precinct in cuffs, and then on to Central Booking shortly after midnight, the suit says. Officials there told the officers they would not process her because medical staff there "did not know how to deliver a baby," the filing says.

The officers then took her back to the precinct for a third time. At about 5 a.m., Doe started having contractions again and was taken back to the hospital in cuffs.

When she arrived, she was placed into a wheelchair, and then the officers "placed heavy shackles on her feet, binding her legs together at her ankles," the suit says.

Over the next hour, "a growing number of staff" told the officers they had to remove the shackles, the filing says. The two officers refused and maintained they were following "procedure," the suit says.

"Approximately ten minutes before Ms. Doe delivered her daughter," one of the officers unshackled her ankles and one of her hands, the filing says. The other hand was cuffed to the hospital bed. She gave birth at 6:14 am, the suit says.

Soon afterwards, the officers chained her feet back together. When doctors handed her baby over her to Doe, she had to struggle "to feed her daughter using just one arm," the suit says.

She remained cuffed and shackled until she was arraigned via video conference at 3 pm, the suit says.

Chandran wouldn't comment on the status of her criminal case. He said Doe's daughter is healthy "and doesn't appear to have any long-term complications."

The suit, which was filed Thursday and first reported by the New York Times, seeks unspecified money damages. Chandran said his client's main concern is making sure that what happened to her does not happen to anyone else.

"It was horrifying," he said.

The suit notes that the American Medical Association, the Federal Bureau of Prisons and the American College of Obstetricians and Gynecologists all oppose shackling pregnant women "during labor, delivery and postpartum recovery."