But after a week of peaceful protests following the death of 25-year-old Freddie Gray, whose spine was broken while in police custody, city officials seemed to be unprepared for the scale of the rioting after his funeral on Tuesday. A CVS chemist and a nursing home were burned down, and looters broke into stores around the city.
Baltimore has a black police chief and a black mayor. Forty per cent of the police force are black, as are more than half of the city's council members. Asked about the risk of riots in Baltimore following the death of Freddie Gray that might resemble those in the Missouri town of Ferguson last summer, a former police commissioner told NPR radio that the city had good race relations and predicted that the population would be calm. On Wednesday, Mayor Stephanie Rawlings-Blake was forced to defend her handling of the crisis after a state of emergency was declared and the state governor deployed 2000 National Guard troops to restore order.
Like many other American cities, Baltimore is a place of racial contrasts. Its leafy, predominantly white, suburbs were untouched by the rioting but the city itself has a diminishing population, with 150,000 abandoned buildings, and is struggling to overcome endemic poverty.
More than 27 per cent of black teenagers are unemployed, compared to 16 per cent of whites of the same age. Baltimore has the fifth highest murder rate in the United States.
Obama, a black former community organiser, spoke about what he thinks should be done. For him it's not just about law and order but about addressing the broader social context. The alternative, he said, would be "the same cycles of periodic conflicts".