

RIO DE JANEIRO — A month before Rio de Janeiro hosts South America’s first Olympic Games, two cellphone videos have brought home the grim reality of rising violence in the city’s teeming favelas — the poor communities that are home to almost a quarter of its population.
In one clip, children cower in fear in a gondola while a gun battle rages below at 4 o’clock on a Monday afternoon. The clip hit the Internet on the same day Mayor Eduardo Paes told CNN the state government is doing a ‘‘terrible’’ job with security. By Monday night, the video was on the front page of Brazil’s biggest news site, the Globo network’s G1.
That morning, police and firefighters had organized a protest at Rio’s international airport over violence and unpaid salaries. ‘‘Welcome to hell,’’ a banner read. ‘‘Police and firefighters don’t get paid, whoever comes to Rio de Janeiro will not be safe.’’ It was their second demonstration at the airport, which will receive Olympic participants and visitors.
The second video, released Friday, shows a baying crowd following police officers hurriedly carrying a 16-year-old boy they had shot and bundling his body into the back seat of their car in the Borel favela. He died en route to a hospital.
The violence is deepening anguish and anger among residents, and it comes at a time when Rio’s state government is broke and has slashed police budgets by a third.
It was a calm Monday afternoon when a young mother set out with her 3-year-old daughter and 2-month-old son, along with two friends and one of their sisters, just 10, for a spin around the Complexo do Alemão favela, not far from Rio’s international airport. But when they were leaving the Palmeiras station, one of six served by a cable car network, a gun battle broke out below them between police and a drug gang.
‘‘It was the most horrible thing. It was desperation. The children were crying, and we were trying to protect them. There is a big risk of a bullet hitting,’’ the woman said. She spoke on the condition of anonymity because of fear of reprisals — from the gang or police.
The complex of favelas was pacified by police and military after a battle in 2010, a high-stake operation carried live on TV. The ‘‘pacification’’ policy was initiated in 2008 to bring peace to communities dominated for decades by violent drug gangs, and armed police bases have since been installed in 38 of Rio’s favelas.
But peace has been hard to come by, said the mother, who filmed the video and was surprised when it went viral.
‘‘It is very difficult. We don’t live with it. We survive it. Out of nothing there is a gunfight, and there are residents in the street, children coming out of school,’’ she said.
A police spokesman said by e-mail that officers had been told armed gang members had been seen in the area and officers were fired upon when they went to investigate. Three other confrontations were registered Monday evening. No injuries were reported, police said.
The second video was recorded after Jhonata Alves, 16, was fatally shot in the Borel favela on Thursday. According to local media reports, he was carrying a bag of popcorn when police opened fire and killed him.
The police spokesman said officers had stopped two men on a motorcycle and that one of them opened fire, as did other men in a nearby alley. He said police opened fire in response.
Residents blocked streets and threw rocks at the officers.