Dozens of people were arrested as hundreds of demonstrators took to the streets of New York City Thursday, protesting a pair of fatal police shootings of black men this week.

The protests were mostly peaceful, though there were occasional clashes captured on video and photos posted to social media. At least 40 people were arrested, mostly for disorderly conduct, by Thursday night, police said. There were no immediate reports of injuries to either officers or protesters.

Hundreds began gathering in Union Square in the evening, seeking answers and demanding justice in the shootings of Alton Sterling and Philando Castile. They began marching in various groups through different parts of Manhattan.

In Times Square, a woman was tackled to the ground by a sea of officers, video shows. Officers also zip-tied several demonstrators when they blocked an intersection and wouldn't follow instructions to leave. The demonstrators were loaded onto an MTA bus to be transported to a local police station.

The impassioned protests, however, were otherwise peaceful. Marchers said they were tired of the injustice and that they don't plan to stop demonstrating.

"It's going to keep on happening until we reform the system," said Jess Florez.

The shocking immediacy and intimacy of the Facebook live-stream video capturing Castile's death inside his car has reverberated with many in New York. Andre T. Mitchell, founder of Man Up Inc., a Brooklyn-based organization that works to building bridges between the community and police, said the video destroys advancements in trust.

"It disrupts and it crumbles all of the progress that's been made, it's unfortunate," said Mitchell. "It just sets us back."

"It is not a good day right now across the nation, especially here in Brooklyn," he said.

But, Mitchell cautioned, those on the front lines of the fight for peace need to "maintain our discpline."

"If you're going to move, move in a very responsible, organized manner, and not overreact," he said.

Mayor Bill de Blasio addressed the shootings Thursday, saying, "I'm reeling after watching these videos... this is not what America is supposed to be."

"No parent of color, or a parent of a child of color in this country can watch that and not be afraid. You feel for the life of child when you see a situation like this," he said. "That’s the problem here, I have tremendous respect for law enforcement, but what the age of the cellphone video has done has made this very personal for many Americans."

"Every day we honor and respect everyone who is a part of law enforcement, but when you look at that video it begs the question: what kind of training did these officers receive, what were they told on how to do their job? Because it's not the right way," he said.

"In this city, we made the decision to retrain all of our officers and put a particular emphasis in the training for our new recruits," de Blasio continued. "We would focus on de-escalation approaches, helping them to communicate with people in the community. This should be a deferral priority, that all of our officers get trained in this."

NYC bus loaded with #BlackLivesMatter protestors taken from protest in Times Square. pic.twitter.com/QWfKQIuyl4 — Micah Grimes (@MicahGrimes) July 8, 2016

Castile was killed Wednesday night in the St. Paul suburb of Falcon Heights during a traffic stop. His girlfriend Diamond Reynolds told reporters Thursday the couple and her daughter had gone shopping and Castile had just been to the barber for his upcoming birthday when a St. Anthony cop pulled them over.

She said the officer asked them if they knew they had a broken taillight, and they responded no.

Reynolds said the officer asked them to put their hands in the air, and they complied. The officer then asked Castile, who was driving, for his identification.

She said he kept it in a wallet in a right-back pants pocket.

"As he's reaching, he lets the officer know, 'I have a firearm on me,'" Reynolds said, adding that he was licensed to carry and "nothing in his body said intimidation."

Rally in Union Sq. Happening now. Justice for Black bodies. A photo posted by tyronedavisjr (@tyronedavisjr) on Jul 7, 2016 at 2:03pm PDT

#altonsterling #philandocastile protest now in union square 5-7 A photo posted by Ella Desmond (@alliheardwasella) on Jul 7, 2016 at 1:47pm PDT

That's when the officer, she said, drew his weapon and fired off up to five shots at Castile, ordering, "Don't move, don't move."

Reynolds said the officer appeared to be crying after the shooting. "He was frantic and very, very nervous."

"He didn't have any last words," Reynolds recalled. "His eyes rolled into the back of his head and he was gone instantly."

Castile, who would have turned 33 on Friday, died at the hospital around 9 p.m. local time Wednesday. An autopsy was pending Thursday.

Diamonds said she recorded the aftermath on her cellphone and put it on Facebook because "I wanted everyone to know that no matter how much the police tamper with evidence ... I wanted to put it on Facebook and go viral so that the people can see."

Minnesota Gov. Mark Dayton said in a statement Thursday morning that he asked the White House to compel the U.S. Department of Justice to begin an independent federal investigation into Castile's shooting.

Castile was a cafeteria supervisor at J.J. Hill Montessori School in St. Paul.

Saint Paul Public Schools said in a Facebook post Castile graduated from Central High School in 2001 and had worked for Saint Paul Public Schools (SPPS) since he was 19 years old, beginning in 2002, in the Nutrition Services Department.

"Colleagues describe him as a team player who maintained great relationships with staff and students alike. He had a cheerful disposition and his colleagues enjoyed working with him. He was quick to greet former coworkers with a smile and hug," the statement said.

Reynolds described him as a "very, very sweet man" who cared for his family and wasn't involved with street gangs.

The officer "took a part of my heart," she said. "He took a part of my soul."

Speaking to reporters on Thursday, Minnesota Gov. Mark Dayton said he was "shocked and deeply, deeply offended" that an incident like this took place in Minnesota. He said the officer's response was "way in excess" for a traffic stop.

"Would this have happened if the driver and the passengers had been white?" he asked. "I don't think so."

It's the second police-involved shooting of a black man to gain nationwide attention in as many days. Alton Sterling was killed by police in Baton Rouge, Louisiana. The U.S. Department of Justice said it will investigate that death.

President Obama was "deeply disturbed" by the two shootings, according to a White House spokesman.

"We've seen such tragedies far too many times, and our hearts go out to the families and communities who've suffered such a painful loss," Obama said in a message on Facebook later.

Obama added that regardless of the outcome of the investigations the shootings are "symptomatic of the broader challenges within our criminal justice system, the racial disparities that appear across the system year after year, and the resulting lack of trust that exists between law enforcement and too many of the communities they serve."