NEW YORK — A mother jailed after police violently pulled her toddler son from her arms was released Tuesday night. A judge had ordered her release earlier in the day after Brooklyn District Attorney Eric Gonzalez said he was dropping all charges against Jazmine Headley, 23, "in the interest of justice."

"I'm just so grateful to everyone and I'm just happy to be free and I just need to see my boy," Jazmine Headley said following her release from the Rikers Island jail facility.

Headley, who was being held on a warrant in an unrelated credit card fraud case in New Jersey, is due to appear in court Wednesday in that matter.

Get Breaking News Delivered to Your Inbox

In dropping the Brooklyn charges, Gonzalez said he was "horrified by the violence depicted in the video," which showed officers yanking Headley's 18-month-old son from her arms.

"The consequences this young and desperate mother has already suffered as a result of this arrest far outweigh any conduct that may have led to it: she and her baby have been traumatized, she was jailed on an unrelated warrant and may face additional collateral consequences," Gonzalez said in a statement.

He said that continuing to pursue the charges — obstructing governmental administration, resisting arrest, endangering the welfare of a child and trespassing — "will not serve any purpose and I therefore moved today to dismiss it immediately in the interest of justice."

Nyashia Ferguson, a witness, said a security officer confronted the woman, who had been sitting on the floor of the crowded city Human Resources Administration (HRA) office for hours because of a lack of chairs. Headley's family told CBS New York she had been waiting nearly four hours to renew daycare vouchers.

"The security guard, I guess she came over and told her she couldn't sit there. So she's like, 'Where am I going to sit?' She was like, 'I guess you're going to just have to stand.' She said, 'Well, I'm not going to stand with my son,'" Ferguson told CBS New York. "She was like, 'What is the crime? What did I do wrong?' And then it just escalated."

Police responded, and the woman ended up lying face-up on the floor during a tug of war over the child. At one point, an officer can be seen on the video pulling her stun gun and pointing it at people in the angry crowd.

The New York City Police Department (NYPD), which called Friday's confrontation "troubling," said security guards had "brought the woman to the floor" before officers arrested her. Ferguson disputed that, saying a police officer had forced the woman to the floor. Police Commissioner James O'Neill said the NYPD officers' body cameras will be reviewed.

"It's disturbing, but we have to see what led up to the event," he said.

New York City Mayor Bill de Blasio praised the prosecutor's decision on Twitter. "This morning my office spoke to the Brooklyn DA about dropping the charges against Ms. Headley. I applaud the DA's decision to do so. She should be reunited with her child as soon as possible," de Blasio wrote.

Headley's family told the station the ordeal and the use of force were unnecessary.

"There was no reason for NYPD to tug and pull like the way they did with him — he was rag-doll basically. And she was really trying to protect him, and you heard him screaming," said the child's grandmother, Jacqueline Jenkins, who is now caring for the boy.

The peace officers at the Human Resources Administration have been placed on modified duty, the station reports. Department of Social Services Commissioner Steven Banks said in a statement Monday he was "deeply troubled" by the incident, saying city social services offices should be "safe havens for New Yorkers needing to access benefits to improve their lives."

He said he would implement re-training on de-escalation for staff, security guards and peace officers.