RIO DE JANEIRO — I n the first quarter of 2019, the police killed an average of seven people a day in this city, the second most populous in Brazil. That’s the highest number in two decades. Even more atrocious is the fact that state security forces are responsible for 38 percent of the violent deaths in the city.

Many of these killings are concentrated in police operations, supposedly aimed at drug traffickers, in the largest of the slums that Rio calls favelas. Carried out with an apparatus that includes armored cars, helicopters and snipers, the campaign has brought about the deaths of many innocent civilians. Among them were six youths, aged 16 to 21, who were killed in just five days in August; one was a professional soccer player; another was a woman carrying her son in her arms. On Sept. 20, 8-year-old Agatha Vitória Sales Félix was struck in the back by a police bullet while riding with her grandfather in a van. She died before she could reach a hospital. Stunned and irate onlookers said military police officers had been shooting at a motorcycle as it passed the van.

It’s hard to remember that in 2016, Rio hosted the Summer Olympics and the city seemed to be on a path to prosperity for years to come. But in just three years, that image of Rio has vanished.

What has happened?

First, a succession of political, economic and security crises in Brazil led its citizens into a deep distrust of traditional politicians. Soon violence, already high during previous years of economic prosperity, worsened. In 2014, the least violent year in two decades, 1,552 homicides were recorded in the city, a rate of 24 per 100,000 inhabitants. In 2017, the total soared to 2,131, and the rate to 32.5 per 100,000 inhabitants. Among the many causes was a decline in a “pacification” policy for the favelas. Under that policy, the government tried to create a community police force. Called the Pacifying Police Units and assigned to resolve conflicts between organized crime gangs, the program ultimately failed because of a lack of resources.