Six hours into a remarkably peaceful protest of the death of a man in police custody, a confrontation outside Camden Yards baseball park suddenly turned violent Saturday night as demonstrators clashed with fans who had turned out for a ballgame.

Before the melee was over, six unoccupied police cars had been damaged by protesters and police in riot gear and on horseback moved methodically to push the demonstrators from a key downtown intersection.

For hours, the police had kept their distance as nearly 1,000 people angered by the death of Freddie Gray while in police custody marched from the downtrodden neighborhood where he lived and died to the more upscale Inner Harbor area and City Hall.

After passing by the ballpark once, they returned to it a second time as fans began to make their way from parking lots and nearby bars toward the stadium for an Orioles-Red Sox game.

A confrontation occurred at three bars with sidewalk cafes, where words were exchanged, items were tossed, and tables and trash cans were toppled. A bottle shattered a restaurant window. A protester grabbed a woman’s purse, and a man chased him.

Protesters confronted officers and vandalized cars during a march in downtown Baltimore against the unexplained death of a black man while in police custody. (Reuters)

The police did not become involved. “They just stood there,” said Alan Hastings, who was having a pregame beer with his wife.

After the crowd dispersed, a phalanx of police then swept down Howard Street to protect several police cars that were being pummeled. The demonstrators, now reduced in number to about 200, used a metal barrier to smash the window of one police cruiser, kicked in the windshield of another and plucked a police officer’s cap from through another shattered window, waving it as if in triumph.

The officers, in riot gear for the first time since the day’s protest began, shouted, “Move back! Move back!” as they inched forward to clear the intersection of Camden and Pratt streets. A few of the protesters spat at them.

At 8 p.m., a police helicopter flying overhead broadcast that those in the remaining crowd would be arrested if they did not disperse. Twelve people who appeared to be causing the most trouble were arrested, Police Commissioner Anthony W. Batts said at a news conference. The others dispersed.

Most of the crowd began to leave, many heading toward their West Baltimore neighborhood. Several teenagers whom Batts identified as protesters ran into a 7-Eleven store at Howard and Fayette streets, snatching items.

Late last night spectators who had attended the ballgame were asked to stay inside the ballpark “until further notice.” About 25 minutes later, Baltimore’s Office of Emergency Management said the request had been lifted.

Until the evening confrontation, the march had been the antithesis of Ferguson, Mo., where police in full riot gear clashed with demonstrators after Michael Brown was shot to death by a white police officer in August.

“I am, to a degree, disappointed,” Batts said. “We worked very hard to allow the protest. The vast majority of people expressed their views and went home. A small number of people felt they had to turn this into an ugly event, an ugly day.”

Also rejecting the disruptive acts was Gray’s sister, Fredericka.

“My family wants to say: Can y’all please, please stop the violence? Freddie Gray would not want that,” she said at a news conference. “Freddie’s father and mother don’t want no violence. Violence does not get justice.”

The officers encountered by the marchers Saturday — notably at the Western District police station and City Hall — wore everyday uniforms, not the helmets and body armor often seen in tense situations.

It was this city’s largest protest since Gray, 25, died from a severe injury to his spine a week after police subdued him in an April 12 arrest. His name has been added to the roster of black men who have died in recent months in encounters with police, including Brown in Ferguson, Eric Garner in Staten Island and Walter Scott in North Charleston, S.C.

On reaching City Hall on Saturday after winding through the city, protesters showed a desire to avoid violent confrontation. A man tried to rush through a space between metal barriers, but two female protesters grabbed him.

“Hold him back,” the women yelled.

As a row of about 30 police officers stood behind the barriers, the protesters chanted: “Who do you protect? Who do you serve?”

Adam Jordan, 27, who leads one of the Baltimore protest groups, told the crowd that their message was getting through.

“People want justice. They want the officers to go to jail. But most of all, they want reform — sweeping reform,” Jordan said.

But in noting the impoverished neighborhood of Sandtown-Winchester where Gray lived and was arrested, he said the root causes of tension are not being addressed. Gray’s community is one of the city’s most depressed.

“Officials are not interested in bettering our neighborhoods,” he said. “People are tired of their quality of life, and they’re frustrated nobody helps them. They want to be heard, and they will do what it takes.”

The demonstrators gathered at Mount and Presbury streets just after noon, where speakers called on them to close down the city, and they responded: “Shut it down! Shut it down!”

“Police have a tradition to dehumanize, to beat down and to show people who’s in charge,” the Rev. Graylan Hagler, pastor of Plymouth Congregational United Church of Christ in Northeast Washington, told the crowd. “It’s the blue uniform. Stand up and stop police from disrespecting our community. Freddie Gray is one of many.”

Larry Holmes, 63, who came from New York, objected to warnings about outsiders agitating violence.“Jesus was an outside agitator,” he told the crowd. “If I’m an outside agitator, guilty as charged. We need more outside agitators to reclaim our communities.

Holmes added: “We, too, would like to come home from our jobs and to our wives and our children and live in peace. But we are oppressed.”

Noting that police officers had to be brought in from other jurisdictions to bolster the Baltimore force, he asked, “Aren’t they outside agitators?”

As children on bicycles raced ahead of the protesters Saturday, they took up a chant: “Cops say, ‘Stand back.’ We say, ‘Fight back.’ ” Among the signs they waved: “Your son yesterday, my son tomorrow;” “Jobs, not police killings;” and “We’re just chillin’ until cops stop killin.’ ”

At the Western District police station, demonstrators were met by metal barricades with a row of officers behind them. Two rows of police sealed the main entrance to Camden Yards, several hours before the game, and one protester shouted at them, “You should be ashamed of yourselves.”

The police remained silent.

Police protected the perimeter of the march as it moved through the Inner Harbor, stopped traffic at major intersections and headed to City Hall.

A police spokesman, Capt. Eric Kowalczyk, said a police helicopter was watching from above, but otherwise the police were intent on keeping a low profile.

Even when a couple of protesters, after moving on from City Hall back toward Camden Yards, lay down briefly at the busy intersection of Pratt and Light streets, police did not move to arrest them. But when the marchers returned to Camden Yards, the police were wearing blue helmets.

Mayor Stephanie Rawlings-Blake (D), her police commissioner and faith leaders said before the protest that they feared that visitors might try to stir trouble.

Gray died April 19, a week after the police chased him down in a project in West Baltimore and arrested him. Police said he suffered a severe spinal injury while in their custody, either during the arrest or during his 30-minute ride in a police transport wagon.

On Friday, police admitted serious errors in Gray’s treatment — he wasn’t buckled in the back of the van despite being handcuffs and shackles, and several pleas for medical help were ignored.

But Batts said the investigation is far from complete and will continue long after files are turned over to prosecutors May 1.

“We know that he was not buckled into the transportation wagon, as he should have been,” Batts said. “No excuses for that. Period. We know our police employees failed to give him medical attention in a timely manner, multiple times. There are still many questions that we still don’t have the answers to.

Batts said the medical examiner’s preliminary report notes a severe spine injury but does not yet list a cause and manner of death. He said doctors are awaiting a toxicology test that could take up to 30 days. He said experts on the spine were being consulted. “We will continue to follow the evidence wherever it goes.”

Lynh Bui and Martin Weil in Washington contributed to this report.