Former Maryland governor Martin O'Malley speaks at a Democratic fundraiser at Gibson's Bookstore and True Brew Cafe on March 6, 2015, in Concord, N.H. O'Malley is considering a run for president. (Darren McCollester/Getty Images)

Democrat Martin O’Malley weighed in Saturday on the national debate about policing that now includes the city where he was mayor, and where the police strategies he implemented provoked heated debate.

Speaking to an audience of party activists here, O’Malley called the police-custody death of Freddie Gray part of “a painful history in our country, a legacy that we continue to work on and work through and seek to overcome every day.”

“We have been seeing far too many tragic videos of police-involved deaths in our country,” said O’Malley, who became Maryland governor after serving as Baltimore mayor, and is considering a White House bid. “We have to make all our institutions more open and transparent.”

It was as a crime-busting mayor some 15 years ago that O’Malley first gained national attention. Although he is positioning himself as a progressive alternative to Hillary Clinton, O’Malley also touts a police crackdown during his time as mayor that led to a stark reduction in drug violence and homicides as one of his major achievements.

Yet some civic leaders and community activists in Baltimore portray O’Malley’s policing policies in troubling terms. The say the “zero-tolerance” approach mistreated young black men even as it helped dramatically reduce crime, fueling a deep mistrust of law enforcement that flared anew last week when Gray died after suffering a spinal injury while in police custody.

Police in Baltimore — like their counterparts elsewhere — have had strained relations with African Americans for generations. But community leaders say the relationship reached a nadir during O’Malley’s tenure, thanks to a policing strategy that resulted in tens of thousands of arrests for minor offenses such as loitering and littering.

Although prosecutors declined to bring many of the cases, activists contend that those who were arrested often could not get their records expunged, making it harder for them to get jobs.

“We still have men who are suffering from it today,” said Marvin “Doc” Cheathem, a past president of the Baltimore branch of the NAACP, which won a court settlement stemming from the city’s policing policies. “The guy is good at talking, but a lot of us know the real story of the harm he brought to our city.”

Bishop Douglas Miles, a community leader, said O’Malley’s department “set the tone for how the police department in Baltimore has reacted to poor and African American communities since then.”

“None of us are in favor of crime,” Miles said. “But we also recognized that you couldn’t correct the problem through wholesale arrests.”

For all the criticism, O’Malley twice won election as mayor, capturing nearly 67 percent of the Democratic primary vote in 2003 on his way to a second term. In an interview Saturday, he said he believes to this day that his administration did the right thing.

Then-Baltimore Mayor Martin O'Malley talks to senior citizens in Prince George's County in this 2006 file photo. (Sarah L. Voisin/The Washington Post)

“They were individual arrests, and oftentimes of the same people again and again and again,” O’Malley said. “We achieved the biggest reduction in . . . crime of any city in America, and none of it was easy. All of it was hard. But there were very few people who want to return to those violent days of 1999.”

Crime fell during O’Malley’s mayoralty, with the number of homicides declining by 16 percent — part of a wider decline across much of the country. At the same time, the number of arrests in Baltimore soared, reaching 108,447 in 2005, or about one-sixth of the city’s population.

“What was positive was that there was zero-tolerance for criminals and drug dealers locking down neighborhoods and taking neighborhoods hostage,” said the Rev. Franklin Madison Reid, a Baltimore pastor. “Does that mean there was no down side? No. But the bottom line was that the city was in a lot stronger position as a city after he became mayor.”

Benjamin T. Jealous, a former president of the national NAACP who worked with O’Malley when Maryland abolished the death penalty in 2013, credited him for supporting a civilian review board as mayor and for a sharp drop in police shootings that occurred during that time. Jealous said O’Malley’s “mass incarceration” police strategy is “a separate issue” than police brutality, and “a conversation for a different day.”

“It was a period where a lot of mayors were doing whatever they could to try to reduce crime,” Jealous said.

But others wonder about a hidden cost.

A. Dwight Pettit, a Baltimore lawyer whose clients have won numerous settlements from police brutality complaints, said O’Malley’s “approach to policing when he was mayor was disregard for the Constitution.”

“His philosophy was, ‘Put them in jail and figure it out later,’ and that will solve the crime problem,” he said. “It created a confrontational mentality with the police.”

Over the past year, as he has criss-crossed the country, O’Malley has talked about alleged police misconduct in places such as Ferguson, Mo. and North Charleston, S.C. On Saturday, he called Gray’s death “another awful and horrific loss of life.”

“Whether it’s a police custodial death or a police-involved shooting,” O’Malley said, “we all have a responsibility to ask whether there’s something we can do to prevent such a loss of life from happening in the future.”

Earlier this month, at a civil rights event convened by the Rev. Al Sharpton, O’Malley said his crime-reduction efforts as mayor saved many lives. “There are a thousand fewer black men in Baltimore who died violent deaths over the last 15 years than otherwise would have died had we not come together.”

Sharpton — who said he invited O’Malley to speak at the convention because he is a potential presidential candidate -- still recalls O’Malley’s police strategies when he was mayor, which he criticized at the time for leading “to a lot of racial profiling and harassment of black men.”

“It breeds mistrust when you have everyone stopped two or three times,” Sharpton said. “It permeates throughout the community.”

Baltimore’s history is rife with moments when tensions between the police department and black residents flared. In 1942, for example, 2,000 African Americans from Baltimore marched in Annapolis to protest the fatal shooting of a black soldier by a white city police officer. Nearly 40 years later, the local NAACP branch demanded a federal investigation into police brutality in the city.

In 2005, with O’Malley in office, Cheathem recalled the local NAACP branch being “inundated with calls from African Americans and Hispanic men saying they were being arrested and no charges were being filed.”

A contingent of activists “met with the mayor and shared our anger — that these guys weren’t being charged but were coming out with arrest records,” Cheathem recalled. “We requested that this process be stopped, and he was not receptive to it at all. We left with the idea that we had no recourse but to sue.”

The NAACP joined in a lawsuit filed by the ACLU that was based on the arrest of a 19-year-old man with no prior criminal record who spent hours in jail for dropping a candy wrapper on the street while sitting on the steps of his aunt’s house. The suit named O’Malley and other Baltimore officials, including the police commissioner, and alleged that the Baltimore police had improperly arrested thousands of people “without probable cause and in violation of the U.S. Constitution.”

The complaint was settled four years later, with Baltimore agreeing to pay an $870,000 settlement. By then, O’Malley was governor. But the memory of his police strategy endured.

“We’re not saying the mayor had ill intentions,” said state Del. Jill Carter (D-Baltimore), a longtime O’Malley critic. “He probably had the best intentions. But when all the evidence hit that this was creating more problems, he should have been able to reassess it.”

Peter Hermann contributed to this report.