Residents and public officials in Rio de Janeiro scrambled earlier this week to come to terms with a weekend of mass robberies along the city's popular beachfront and upscale neighborhoods nearby.
The assaults, carried out by swarms of young bandits combing beaches and crowded sidewalks, pilfering whatever they could, come less than a year before Rio hosts the 2016 Olympics. They coincide with a deep economic downturn that has exposed old fault lines between rich and poor.
In neighborhoods like Copacabana, a beach district where sun-seekers from across the economic spectrum famously converge, the assaults prompted a backlash from residents, including revenge attacks on buses carrying passengers back to poor neighborhoods where some assailants are believed to live.
"After assaults, violent reaction," read a front page headline in O Globo, the city's leading daily, beneath a photo of two men breaking a bus window as police, one with a pistol drawn, stand by.
In a city long known for gaping inequality, the incidents prompted uproar over tactics and preparedness of local authorities to stem what many fear could be an increase in crime and social tensions as Brazil struggles with recession.
It is too early to say whether the economic downturn is fueling a long-term worsening of crime, but in Rio there has been an increase in frequency and intensity of dragnets as the gangs' crime sprees are known.
Human rights groups in recent weeks have criticized police for racially profiling young minorities on their way into the city, sometimes removing them from buses before they make it to wealthy areas.
Meanwhile, residents complain that security forces cannot compensate for the shortfalls in education, housing and other public services that social scientists say alleviate crime.
"Our public policies have failed and now security is failing, too," said Regina Chiaradia, president of a residents' association in Botafogo, a neighborhood where gangs stormed the beach and inland streets.
Authorities vowed to double down on tactics they say prevent "vulnerable" youths from putting themselves in situations where they could commit crimes.
Speaking to local radio, Rio's state security secretary dismissed criticism that bus searches amount to profiling, saying that many of the minors police stop don't even have money for fares home.
"It's not a question of race," said Jose Mariano Beltrame, the secretary. "The key word for police involvement is vulnerability."