They flooded the Vine Street Expressway late Monday afternoon with fists and voices raised — thousands waving signs, kneeling on the asphalt, bringing to a halt one of the city’s busiest thoroughfares.

Black, white, and brown, many of them younger adults, they shouted out cries, the same ones heard for days in Philadelphia and across the country, for racial justice and an end to police brutality.

Then, officers launched tear gas onto the marching crowd, sending the protesters scrambling up the banks on both sides of the highway as gas filled the air. Within minutes, videos and images of people screaming, trapped, and desperate to escape flooded social media.

The gassing and the chaotic swarm it caused created one of the starkest moments in Philadelphia of the last three days — outraging and stunning protesters who said their demonstration was peaceful.

The melee, an hour before the city’s 6 p.m. curfew was set to take hold, came on a day when the National Guard came to aid city and state police, and city officials again pledged that the violence of previous days — smashed windows, ransacked businesses, and vandalized police cars — would not be tolerated. At least dozens of demonstrators were arrested Monday after the I-676 incident, and later in the evening police sought to more forcefully clear the streets when the curfew arrived.

The incident further enraged protesters who, as in previous days, had used largely nonviolent demonstration to call for change in the wake of the death of George Floyd, the black man who died last week after a Minneapolis police officer knelt on his neck.

“How can you expect us to be peaceful and then you — you attack us. You get mad when we violent, but when we peaceful, you still get mad. So what is the answer?” said protester Kai Mickens of Coatesville, her voice straining with emotion. “Is there an answer?”

City officials on Monday said they were trying to sort out what had happened and which agency had released the gas. In a late-night statement, Mayor Jim Kenney and Police Commissioner Danielle Outlaw said Philadelphia SWAT officers had released tear gas and non-chemical white smoke after an officer ordered the crowd to disperse because some protesters had thrown rocks.

The gas was “a means to safely defuse a volatile and dangerous situation and restore order,” Outlaw said in a statement.

Kenney said the officers were concerned about the safety of protesters and drivers. “I want to assure the public that this was not a decision that anyone took lightly,” he said.

Deana Gamble, a spokesperson for Kenney, said the information about protesters throwing rocks came from firsthand accounts of high-ranking police commanders who witnessed the incident. “Some were [hit] and one in particular remembers because he didn’t have a helmet on, so he needed to duck,” she said.

As protesters questioned the gassing, City Councilmember Helen Gym called on Kenney to “ask militarized forces to stand down." Councilmember Jamie Gauthier said later that the incident “undermined our credibility” as a city government.

“We can’t on the one hand say that we hear people and we understand them," Gauthier said, "and on the other hand use these kinds of tactics against them for expressing their opinions and expressing their anger about something they should be angry about.”

The expressway protest had partly originated from a peaceful “speakout” at Police Headquarters earlier in the afternoon and grew as groups joined to march to City Hall and then continued up the Parkway to reach I-676. They walked down the expressway, chanting, “No justice, no peace, no racist police" and stopped traffic as far as the eye could see.

Ebony Ukogu, 24, was chanting with the crowd, carrying a sign that read “Stop Killing Us," when suddenly people ahead of her started running and she saw police in riot gear.

“They were coming toward us. And then, all the sudden, I blink, and my eyes are on fire," she said. "Then I start to hear the pops, the sounds of them firing canister after canister of tear gas.”

She said the situation turned dangerous because people had to crawl over each other to flee as officers “continuously" sprayed the gas. Mickens said the tear gas appeared to come both from above and in front of the crowd.

“They have people trapped down there," one woman yelled as people still behind the fences struggled to reach them and jump over, according to a video she posted. “They were peacefully protesting!”

Some protesters near the front also said they were hit by rubber bullets, with one of them showing a reporter a red welt on his chest. At least one video appeared to show Philadelphia sheriff’s deputies using pepper spray on people on the Parkway. Sheriff Rochelle Bilal did not respond to requests for comment.

“We all falling up the hill, trying to climb, jumping over the gate and everything, it was crazy,” said K.J. Williams, 22, one of the people who said they ran from rubber bullets. “It was chaotic. Like it was really like pandemonium."

On the expressway, a large group appeared to be detained by officers. At least 25 people had their hands tied and were seated on the highway barrier, some lined up in front of a Sheriff’s Office bus.

Five hours later, no arrests had been announced by city officials.

“It’s just crazy that we came out here to protest peacefully, to fight for people of our skin color, and we still got gassed," said Zakiyah Ingram, 26, of Philadelphia. “It doesn’t make sense to me."

Staff writers Kristen A. Graham and Oona Goodin-Smith contributed to this article.