A woman who was shackled and handcuffed by police minutes before giving birth was "terrified for herself and her baby," according to a lawsuit against the city of New York.

The city has agreed to pay a $610,000 settlement to the woman, who was 40 weeks pregnant at the time of her arrest in February 2018.

Shackling pregnant prisoners during labor has been banned in New York State since 2009. In 2015, this law was expanded to all pregnant women and new mothers.

The woman, who was involved in a child custody dispute, was detained in a Bronx jail after allegedly breaching an order of protection, according to CNN. The misdemeanor charge was linked to a five-month old incident with her former partner, The New York Daily News reported.

The woman, who was 27 at the time, experienced contractions a few hours after her arrest. She was taken to a nearby hospital with cuffs around her wrists and shackles on her feet, according to her lawsuit.

Doctors protested the restraints, but police did not remove them until "moments" before the woman, referred to as Jane Doe, gave birth. "A growing chorus of outraged doctors convinced the [New York Police Department (NYPD)] to briefly remove her shackles," the lawsuit said, per the Daily News.

It continued: "At. 6:14 a.m., Jane Doe gave birth to her daughter. Shortly after she gave birth, NYPD officers again shackled her, ignoring the doctors' continued pleas. Ms. Doe struggled to feed her new baby with one arm."

During the incident, police maintained they were "following procedure" in the NYPD's patrol guide.

In a statement, per the Daily News, the NYPD will amend its patrol guide to "better address safety and medical concerns associated with arrestees in late stages of pregnancy," as well as "the exceptional circumstance of safeguarding an arrestee through childbirth and until their arraignment."

The NYPD did not immediately respond to Newsweek's request for comment.

Katherine Rosenfeld, the woman's lawyer, told CNN there was no urgent need to arrest her client last February. According to the lawsuit, the woman did not struggle, resist officers or act "in any way that would even remotely support the use of restraints."

The complaint continued: "Doe was terrified for herself and for her baby."

Rosenfeld told The New York Times that doctors present at the birth used the case to teach other healthcare providers about New York's anti-shackling law. In pretrial testimony, doctors said they were appalled by the woman's treatment.

Rosenfeld added: "I think it was very upsetting for doctors to have to see this and witness this, so their testimony was very powerful."

The young woman, now 28, told The Times she doesn't want anyone—including her infant daughter—to know about the traumatic nature of the birth.

"That's a private moment, and that should be a moment where a mother should be happy and safe to give birth to her child and not go through what I went through where it wasn't safe at all," she said.