Martin O'Malley, former governor of Maryland, gestures while speaking at the Democratic National Convention in Charlotte in 2012. (Photo by Scott Eells/Bloomberg)

Former Maryland governor Martin O’Malley warned Tuesday that if the country does not step up investments in its cities, there could be more unrest like that in Baltimore last week.

The Democrat, who is expected to announce a presidential bid later this month, told an audience in Redlands, Calif., that he did not condone the actions of those who rioted and looted following the funeral of Freddie Gray, the 25-year-old African American man who died in the custody of Baltimore police.

“But they do represent the sort of anger that we breed when we create an economy that acts like whole groups of people don’t matter and aren’t needed,” O’Malley said. “And we need to tend to that, and we need to be mindful of it and take better actions if we’re going to avert greater unrest in the future in another city or in other cities.”

O’Malley, a  former Baltimore mayor, said he would like to see “big investments” in areas including affordable housing, mass transit and job training.

“Right now, we are under-investing and that is nowhere plainer to my eyes than when it comes to America’s cities,” O’Malley said in remarks that were streamed live over the Web.

[With little choice, O'Malley defends Baltimore tenure]

His comments echoed those made to reporters in recent days, including during an appearance Sunday on NBC News’s “Meet the Press.” On that show, O’Malley pledged to make urban issues central to his campaign if he runs for president. He is widely expected to launch an uphill bid against Hillary Rodham Clinton for the Democratic nomination.

O’Malley spent much of the past week on the defensive, as critics suggested that his “zero-tolerance” policing policies as mayor had contributed to the distrust of the community in Baltimore. He served as Baltimore’s mayor from 1999 to 2007.

“The things that we need to do to address this are far greater than simply policing or bringing to justice those who smashed police cars or lit other people’s cars on fire,” O’Malley said Tuesday.

He was interviewed by James Fallows, a national correspondent for the Atlantic magazine, in front of a live audience, as part of a program sponsored by Esri, a major software maker, and the University of Redlands Town & Gown.

Esri pioneered the use of Geographic Information System mapping that has been widely employed by governments, including the city of Baltimore and the state of Maryland. At both levels, O’Malley was considered a leader in incorporating such technology into management of government services.

[O'Malley, still positioning as Clinton alternative, pauses to talk about data]

Haley Morris, an O’Malley spokeswoman, said the former governor was paid for an appearance at the company’s campus on Tuesday but that the question-and-answer session with Fallows was not part of that arrangement. Morris would not disclose how much O’Malley was paid.

Since leaving office in January, O’Malley has delivered a series of paid speeches, which he has said is currently a primary source of income for him. O’Malley is also a visiting professor at the business school at Johns Hopkins University.

During his tenure as governor, the state of Maryland expanded its business with Esri. In 2011, a board on which O’Malley sits approved a $2.1 million contract for use of the company’s software and support services for agencies across state government. In 2014, the contract was expanded to $3 million.

Maryland has used the GIS mapping software for a wide range of projects, including tracking land preservation efforts, monitoring the health of the state’s waterways and promoting tourism. Esri promotional materials for Tuesday’s event said that O’Malley was “one of the most technologically-savvy governors in the United States.”