What started as a peaceful demonstration late Thursday through early Friday in the District’s Meridian Hill and Adams Morgan neighborhoods turned into a clash between demonstrators and police.

Police said 41 people were arrested on charges including rioting, arson, assault on a police officer and vandalism. Of the 41 arrested, prosecutors dismissed charges against all but a handful of people, including two who were charged with assaulting a police officer.

The incident unfolded late Thursday evening as dozens of protesters gathered and marched to the D.C. police Third District station at 1620 V Street NW. Based on videos distributed on social media, many of the demonstrators were chanting the names of people who had died in encounters with D.C. police.

Police said that some in the group became destructive and that fires were set to trash cans, outdoor umbrellas at restaurants and newspaper boxes. Property was spray painted and the glass wall at a bus stop enclosure was smashed, police said.

Dustin Sternbeck, a spokesman for D.C. police, said the “decision to make arrests was based on the actions of the people who engaged in reckless behavior.” He said there were many more demonstrators who were not arrested.

During the incident, a small crowd of demonstrators and onlookers jeered at police and attempted to block at least one van that was transporting a group of detained protesters.

One woman, who declined to give her name, said she narrowly avoided being taken into custody when one officer pushed her with a baton as police tried to secure the scene. The woman said a friend jumped between her and the officer. Several other police officers detained him and one used a chemical spray on her, she said. “All of a sudden, the police got aggressive with us,” the woman said at the scene, as she used ice and water to try to soothe burning from the substance.

Jessica Farmer, 36, was sitting on the couch just before 11 p.m. when she heard yelling and what sounded like a firework erupt outside her window. She threw on flip flops and ran downstairs, joining a handful of her neighbors who pulled out their phones to record as about five police officers surrounded a protester and slammed him to the ground, she said.

As the protester lay on the pavement at 18th and T streets, Farmer said, a girl next to him grew frustrated and began yelling louder and louder at the officers. Farmer watched one deploy chemical spray in the girl’s direction, striking her face and hitting another officer in the process.

“We were like, ‘What on earth is this?’ ” Farmer said, recalling the confusion she felt in that moment as she stared down her street, which looked otherwise unchanged. Restaurant-goers, she said, were still finishing their drinks.

She rushed up to her apartment, grabbed a bowl of ice water and hurried back to the injured girl, pouring it on her eyes.

A few blocks away, Adrian Snead, 37, had emerged from his apartment to sounds of screaming and loud bangs. He found newspaper containers, trash cans and a street sign knocked over and sprawled along 18th Street. Concerned, he walked up the block to the sight of restaurant employees hurriedly collapsing tables.

Shortly after, Snead saw Starbucks umbrellas on fire and a crowd converging in the middle of the street, chanting and condemning the neighborhood for its gentrification.

Tysean Hoffman, of Alexandria, who was among the demonstrators, said the group numbered about 50 and began to march from Meridian Hill Park, also known as Malcolm X Park, toward the police precinct. Hoffman said he joined the march to ensure his 7-year-old son could live without fear of police. “I want my son to see a police officer and not be scared,” he said.

Some demonstrators said police kettled groups together and began picking out individuals to arrest. Other marchers said there were about 20 demonstrators and legal observers who were surrounded in the group.

Some marchers who were not corralled said that police used batons and pepper spray on demonstrators as they boxed them in.

Sternbeck said officers “had a responsibility to make arrests of individuals that were intentionally setting fires and destroying property.” He confirmed one officer used a chemical spray. It remained unclear whether any officer struck anyone with a baton, he said. Sternbeck disputed reports from some demonstrators that they were largely peaceful and said two officers were injured.

Peter Hermann contributed to this report.