Civil rights advocates and some elected officials here trace the tensions to “zero-tolerance policing,” a crime-fighting strategy championed by Martin O’Malley, the former governor and a potential Democratic candidate for president, when he was the mayor of Baltimore from 1999 to 2007. Aides of Mr. O’Malley note that on his watch, the number of annual homicides dropped below 300 per year for the first time in more than a decade, and that violent crime in Baltimore dropped by 41 percent. Steve Kearney, a top aide to Mr. O’Malley when he was the mayor, described the policies as “appropriate for the time.”

But zero-tolerance policing led to mass arrests of people for small infractions, as well as intense “community frustration,” Ms. Kumar of the A.C.L.U. said. “Countless innocent people,” she added, “were getting caught up in this dragnet style of policing.”

In 2006, the A.C.L.U and the N.A.A.C.P. sued Baltimore, alleging a broad pattern of abuse. The city settled in 2010 for $870,000 and publicly abandoned zero-tolerance policing. But people here say tensions persist.

In Mr. Gray’s case, the police acknowledged that three bicycle officers pursued him after a lieutenant “made eye contact” with him and he ran away. The Gray family’s lawyer, William Murphy Jr., has said Mr. Gray was pursued for “running while black.” That is one reason his case has provoked such an uproar here.

“I just want them to be able, when they come into our community, not to be afraid of us,” said Darlene Cain, a nurse’s assistant who founded an advocacy group, Mothers on the Move, after her son Dale Graham was killed by a Baltimore police officer in 2008. “Be able to say, ‘Hello, good morning.’ Don’t just sit in your car and look at us like we’re the next person you want to lock up.”