Right as a top Brazilian official was confidently guaranteeing safety at next month's Olympics, Rio cops were about to head to their latest nerve-jangling assignment: body parts discovered on Copacabana beach.
Officially, Rio de Janeiro is all ready to provide security for the some half million people expected to flock to the biggest sporting event on the planet from August 5-21.
Addressing journalists with a month to go before the opening ceremony, Andrei Rodrigues, secretary for major events at the justice ministry, declared his "total confidence."
"I am completely calm," he said.
That's a claim that has since been repeated by everyone from the Rio mayor to the minister of defense.
But as demonstrated by the discovery that same day of an unidentified, dismembered body next to the Olympic beach volleyball site on Copacabana, not all is well in Brazil's "Marvelous City."
And Rio police -- who've seen more than 50 of their colleagues killed just this year and have been protesting against late salary payments -- appear far from calm.
- Street mayhem -
There have been 2,083 murders in Rio state in the first five months of this year, up 14 percent on the same period last year. The number of muggings has exploded and carjackings are also on the rise.
In an embarrassing incident, a truck crammed with more than $400,000 worth of television equipment imported by German broadcasters covering the Olympics was hijacked. It was later recovered.
The real mayhem is isolated in the north and in huge slums known as favelas, rather than in the coastal areas of Barra, Copacabana and Ipanema where tourists congregate.
But with an ambitious eight-year-old community policing project in those favelas facing growing troubles, drug lords are expanding control.
Last month, a gang of about 20 armed men shot their way into a central Rio hospital to rescue a detained boss nicknamed Fat Family. Police have reportedly killed as many as nine people in the brutal ensuing manhunt, but the fugitive remains at large.
- Is Rio a terror target? -
Brazil's lack of involvement in any wars and sheer distance from jihadist strongholds like Syria could be the best defense against any repeat of the kind of mass attacks claimed by or blamed on the Islamic State group in Bangladesh, Belgium, Iraq, Turkey and the United States this year.
But hosting the globe's most watched event automatically puts a bullseye on Brazil, warns Robert Muggah, a security specialist at the Igarape think tank based in Rio.
"If a terrorist group wants to a make a major statement at a global event, Rio would be a good place to start," he said.
Rio will be welcoming hundreds of thousands of foreigners from more than 200 countries, raising the possibility of infiltrators.
The border with Paraguay is also notoriously porous, while procuring the powerful weapons wielded in the favelas would be relatively easy.
In June, Brazil's intelligence service said it had detected Portuguese-language messages linked to the Islamic State group on an online forum. An even more explicit warning came after bloody Islamist attacks in Paris last November, when a French jihadist tweeted that Brazil was the "next target."
Rio's other big concern will be preventing a major cyber attack at a Games that will be heavily reliant on cloud computing, Muggah said.
- Boots on the ground -
Officials say a huge police presence will secure the streets. Between police drafted in from other areas and thousands of soldiers, there will be 85,000 security personnel deployed in Rio and the five cities hosting football competitions -- double the number used in the 2012 London Games.
A police coordination center with officers from 55 countries is to be the biggest such operation of its kind, Rodrigues said. And a separate anti-terror unit will have officers from seven key countries, including the United States and neighboring Argentina and Paraguay.
Background checks have already been made on nearly 394,000 visitors, with the number due to rise to 600,000.
Defense Minister Raul Jungmann said last week that he could guarantee "peace, with the happiness and calmness that we expect."
- Unpaid police 'hell' -
But local issues could be Brazil's Achilles' Heel.
A vote on whether to remove suspended president Dilma Rousseff from office is scheduled for just after the Games, promising political tension and possible demonstrations.
And amid an ugly national recession, nearly bankrupt Rio de Janeiro state has required a 2.9 billion reai ($870 million) federal bailout to avoid what interim governor Francisco Dornelles warns could be "a big failure."
The money is being used in part to pay for late police salaries, months of unpaid overtime and what protesting officers call a lack of even basic supplies such as car fuel and toilet paper.
Angry cops certainly don't share the government's rosy vision.
"Welcome to hell," read a banner they unfurled in the arrival hall at Rio's international airport earlier this month. "Whoever comes to Rio de Janeiro will not be safe."