Potential 2016 presidential candidate Martin O'Malley fired back Sunday at criticism of his record as Baltimore mayor, defending his tenure amid the recent turmoil there and vowing to announce a candidacy in the city.

“I wouldn’t think of announcing any place else,” O’Malley, a Democrat and former Maryland governor, told NBC’s “Meet the Press.”

O’Malley’s 1999-to-2006 mayoral term started coming under heavy scrutiny after black resident Freddie Gray died last month as the result of an injury while in police custody, which sparked rioting and other violence last week in Baltimore.

The turmoil put the scrutiny specifically on O'Malley's "zero tolerance" law enforcement policies as mayor.

The number of murders and other violent crimes declined during that period.

But David Rocah, a staff attorney with the ACLU of Maryland, said the O'Malley administration left a legacy of "hyper-aggressive and militarized policing" that, in his view, contributed to the outrage behind the rioting.

O'Malley, who appears headed toward officially joining the Democratic primary race with Bernie Sanders, an independent from Vermont, and front-running Hillary Clinton, says those judging him in hindsight should remember the crime and despair of the Baltimore he inherited as mayor.

"I don't think that any of us want to go back to the days of 1999," O'Malley said recently outside the Dawson Safe Haven Center, an after-school refuge for Baltimore children that was once a home for a family of seven killed in a 2002 fire-bombing by a drug dealer.

"Our city is undoubtedly a safer place, and our city is becoming a better place, but our city still has a lot of progress to make," he said.

O'Malley has tried to build a following in Iowa and New Hampshire as an alternative to Clinton. He has backed tougher regulations on Wall Street, opposed the Trans-Pacific Partnership trade deal and addressed student debt -- issues that resonate with liberals.

Still relatively unknown, even among Democrats, O'Malley has and even after the rioting continues to point to his time as mayor as a key part of his biography.

In the 1990's, more than 300 people were murdered each year in Baltimore. O'Malley advocated "stop and frisk" practices, cracked down on lower-level crimes such as public drunkenness and disorderly conduct, and brought in two police commanders from New York steeped in such policing. The number of homicides fell to 253 in 2002 and stayed below 300 during his two terms, while never dropping to his goal of 175.

But the approach did lead to many arrests.

In 2005, a Baltimore grand jury found excessive arrests in black neighborhoods and recommended retraining so officers would use better judgment. Judge Joseph McCurdy Jr. had tasked the panel with determining "what can be done to address the lack of confidence that exists between many members of the public and law enforcement."

The ACLU and the NAACP sued in 2006 on behalf of 14 plaintiffs who said they were wrongly arrested as part of a policy that emphasized arrests for minor offenses under O'Malley's watch. The city agreed to the $870,000 settlement in 2010.

O'Malley's successors moved away from zero-tolerance policing. But he hasn't shied away from his record.

When the recent protests erupted, he cut short a trip in England and Ireland, returned to Baltimore and walked the streets to talk to former constituents and community leaders. Some stopped to shake hands or take pictures with him while others told him about their bad experiences with the police. A few heckled him.

Asked about the zero-tolerance policy, O'Malley said, "What we had zero tolerance for was police misconduct. We worked at it every day."

After two terms as mayor, he won two terms as governor with strong support in Baltimore.

O’Malley also told NBC on Sunday that he could indeed run on his record as mayor.

"I did not dedicate my life to make Baltimore safer and more just place because it was easy,” he said. "And I am more inclined and deeply motivated to address what's wrong with our country and what needs to be healed and what needs to be fixed. This should be a wake-up call. What's happened in Baltimore should be a wake-up call for the entire country. … It has to be central” to my campaign.

The Associated Press contributed to this report.