Police are investigating an incident seen in a viral video in which a group of officers, one of them wielding a stun gun, violently pulled a toddler from the arms of a mother who was being arrested at a Brooklyn food stamp office.

Nyashia Ferguson, a witness, said a security officer confronted the woman, Jazmine Headley, 23, who had been sitting on the floor of the crowded office for two hours because of a lack of chairs.

"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."

Get Breaking News Delivered to Your Inbox

Police were called when Headley refused to leave. The woman ended up lying face-up on the floor during a tug of war over the child.

Ferguson posted the video to Facebook and said she was "disgusted" by the incident. "I couldn't believe they was doing that to that child. I just couldn't believe it. It was crazy," Ferguson said.

Other customers in the city office shouted at the officers. At one point, an officer can be seen on the video pulling her stun gun and pointing it at people in the angry crowd.

Headley was charged with obstructing governmental administration, resisting arrest, endangering the welfare of a child and trespassing. As of Monday morning, she was still in jail because there was a warrant for her arrest in New Jersey, prosecutors said.

"We did not request any bail and Ms. Headley's hold is in connection with a warrant from New Jersey," the Brooklyn prosecutor's office said on Twitter. "We are reaching out to authorities in that state to expedite her release."

The Brooklyn public defender's office called on prosecutors to dismiss the charges, asking "why police were ever involved."

"In our experience, people are often treated abysmally when seeking support from many of the city bureaucracies that are supposed to be helping them," Lisa Schreibersdorf, executive director of Brooklyn Defender Services, said in a statement.

Brooklyn Borough President Eric Adams, a Democrat, likened the officers involved in Headley's arrest to "Border Patrol police snatching away" a baby. He called the arrest "a blemish on our entire city."

"The mother didn't endanger the welfare of the child. The actions of the department endangered the welfare of the child," Adams said at a news conference Monday morning. "If it's wrong in Mexico, then it's wrong in New York City."

The Brooklyn district attorney's office said it was independently investigating and "reviewing all available videos and interviewing witnesses with the intention of reaching a swift decision."

The New York City Police Department, which called Friday's confrontation "troubling," said security guards had "brought the woman to the floor" before officers arrested her as she resisted. Ferguson disputed that, saying a police officer had forced the woman to the floor.

"This is unacceptable, appalling and heart breaking," City Council Speaker Corey Johnson, a Democrat, tweeted. "I'd like to understand what transpired and how these officers or the NYPD justifies this. It's hard to watch this video."

A court document said the toddler was just under 18 months old. A family member was taking care of the child, authorities said.

"Being poor is not a crime," said Democrat Letitia James, the city's public advocate and the state's attorney general-elect, in a statement. "No mother should have to experience the trauma and humiliation we all witnessed in this video."