US defense chief hears shots during visit to Rio de Janeiro

US Defense Secretary Jim Mattis speaks during his visit to the Brazilian War College in Rio de Janeiro

US Defense Secretary Jim Mattis got some alarmingly direct insight into Rio de Janeiro's violent crime wave when gunfire burst out close to his hotel during an official visit to the Brazilian city.

Mattis, at the start of a South American tour, said Tuesday the sound of shots overnight had been upsetting.

"You remember every time you hear one of those shots somebody's life could be changing," he told reporters aboard his airplane. "So I didn't make light of it. I was sad to hear it frankly."

Mattis was staying near Copacabana beach, an area where wealthy residents live a stone's throw from an impoverished favela called Chapeu Mangueira.

Rio's many favelas are almost daily witnesses to shootings, either between rival drug gangs or police and drug gangs. Stray bullets are a constant menace to favela residents and also to people living in the surrounding streets.

Mattis acknowledged that parts of the United States also suffer serious gun violence.

"We have some cities in America that we know are tragically having this problem as well. This is what happens if we don't keep, I would call it consensual policing where the whole community helps police and is able to keep lawless elements at arm's length," he said.