National Guard troops and police in riot gear patrolled Baltimore to enforce a curfew, dispersing protesters with tear gas, pepper spray and rubber bullets.

With helicopters overhead and armoured vehicles on the ground, most people respected a curfew that starts at 10pm and goes until 5am all week. However, a few hundred people defied authorities, gathering at an intersection that was the scene of rioting a night earlier.

Rioters plunged part of Baltimore into chaos on Monday, torching a pharmacy, setting police cars ablaze and throwing bricks at officers hours after the funeral of a man who died from a severe spinal injury he suffered in police custody.

Monday's riot was the latest flare-up over the mysterious death of Freddie Gray, whose fatal encounter with officers came amid the national debate over police use of force, especially when black suspects are involved. Gray was African-American.

Baltimore is actually two cities. One is the decaying, crime-ridden area that inspired the gritty television police drama "The Wire". The other is a successful, gleaming city on the waterfront attracting increasing numbers of young affluent residents.

In Baltimore, African-Americans make up nearly two-thirds of the city, one of the largest black populations in absolute and relative terms in cities in the United States. In the Sandtown-Winchester area of Baltimore, where people clashed with police on Monday, nearly 90% are black.

Of the area's residents older than 24, about 57% have not advanced beyond a high school education, 15 percentage points above the national average, according to census data. A third of the homes there are vacant.

By contrast, in the Roland Park area on the more affluent north side of the city, the poverty rate is 10.2%. That zipcode is 80% white, and more than 90% of people older than 24 have attended at least some college.

In the 1950s Baltimore was the sixth largest city in the United States with a peak population of nearly 950,000. Now it ranks 26th, with a population of around 620,000. One quarter of the city's residents live in poverty.

Baltimore is one of the less equal American cities when measured by income and educational achievement. It was ranked 12th out of 50 major US cities in the inequality reading. (Atlanta - which was one of the American cities hit hardest by the housing bust - was the most unequal, according to the Brookings study that covered 2007-2013.)

The economic divide may have provided some of the tinder that led to looting and arson in the city. Growing income inequality has emerged as a key theme ahead of the 2016 presidential election with both Democrats and Republicans calling for the issue to be addressed. President Barack Obama has termed income inequality and the inability to move up the ladder as "the defining challenge of our time".

In a paper published last year, Raj Chetty of Harvard University and his co-authors found the Baltimore area ranked near the bottom of major US cities in terms of mobility.

According to the study, someone born into the bottom fifth of the population in Baltimore stood 6.4% chance of making it to the top one-fifth of the income strata. That compared with an 11% chance in Washington, DC.