The shootout had woken them an hour before. Killings in Rocinha, once the showcase shantytown in Brazil's showcase city, had quadrupled in less than a year. In recent weeks, it had taken on the feel of a war zone as drug traffickers battled with police.
Suddenly, the bullets were buzzing just above the roof. The family members had started sleeping in one room because they felt safer together, and Samantha, a 33-year old who sold coffee in a park, had drilled her girls on an escape plan. When she gave the sign, they would move fast, keeping low, to a windowless, bunkerlike terrace.
Another shot rang out, and Samantha rose, telling the girls to follow, she later recalled. Eight-year-old Natasha moved quickly. But Nicolly, her painfully shy 16-year-old, was still struggling to her feet when they heard the window crack.
And then blood was seeping through Nicolly's pink tank top.
"Mama," the girl said before slumping. "I've been shot."
- - -
Rocinha, Rio's largest favela - or hillside shantytown - was once ascendant, a symbol of rising fortunes in a nation that finally seemed on the fast track to greatness. But a little more than a year after Rio hosted the Olympic Games, that optimism is disappearing in a wave of urban violence.
In Rocinha, residents are using cellphone apps to track shootouts. Schools have closed or shortened their hours because of the violence. In September, the army was called in to help pacify the streets. In November, students were trapped inside their homes by gunfire, unable to take their equivalent of the SATs.
The mayhem in the favela of nearly 200,000 people reflects a national plague. Brazil suffered a record 61,000 violent deaths in 2016, a figure greater than the estimated loss of life that year in Syria's civil war. While the numbers are not directly comparable - Brazil has 10 times more people than Syria - the carnage is still extraordinary.
For Rocinha, it amounts to a painful reversal of fortune. As Brazil's economy boomed in recent years, the green shoots of a middle class had sprouted. Bank branches and jewelry stores opened amid Rocinha's ramshackle huts. Fast-food chains moved in - even sushi bars. Fashion designers came from Paris and New York to draw inspiration from its urban verve. Its hivelike streets were portrayed in the animated Hollywood movie "Rio." Property values for Rocinha's shacks - some with million-dollar views of the Christ the Redeemer statue on Mount Corcovado - soared.
The streets were far safer, thanks in part to the city's pacification police program, which sought to drive out the drug traffickers who had propelled homicide rates to deadly highs in the 1990s and were still ubiquitous.
For many like Samantha, the current crime wave is even worse than Rocinha's earlier years of violence.
"It was nothing like this before," she said. "Nobody locked their doors. In the middle of the night, if you needed something, you'd go out and get it at the pharmacy. You'd go to the cafe if you were hungry . . . at any hour. [But] these are bad times."
- - -
Nicolly was unconscious when her stepfather carried her into Miguel Couto Municipal Hospital, the closest to Rocinha. He was covered in her blood by then. Medical personnel quickly determined she had a bullet lodged just above her left shoulder blade and wheeled her into surgery.
As her stunned mother waited, one gunshot patient after another was rushed in. "Things were on fire," Samantha would later recall.
Such scenes are increasingly common in Rio's hospitals. Doctors say they are struggling to cope not only with a surge in gunshot wounds but also shrapnel from grenades.
"I know doctors, nurses who are afraid to come to work now," he said. "Those who can are thinking about leaving Rio."
- - -
The outbreak of violence in Rocinha was ostensibly triggered by the execution of three top traffickers by rivals in August. But the bigger culprit, observers say, is the erosion of the state in a nation whipsawed by economic crisis and corruption.
A financial scandal cost then-President Dilma Rousseff her job in 2016. Her replacement, Michel Temer, spent the past year fighting corruption allegations. In the Rio state, former governor Sergio Cabral was sentenced in June to 14 years in prison for his part in the massive corruption and bribery scandal known as Lava Jato, or "Car Wash." Authorities say he received more than 224 million reais, or about $67.6 million, related to construction projects, including one involving the government-controlled oil giant Petrobras. The broader Car Wash scandal has rocked Petrobras, causing it to lose billions of dollars and slash spending.
The turmoil has ravaged the budget of Rio, which relies heavily on royalties from Petrobras. Rio state was so close to financial disaster before the Olympics that it needed a bailout from the federal government. The price was deep spending cuts, which are taking a severe toll.
"We don't even have gas for our helicopters," Alves said.
The financial squeeze has made Rio police officers - notorious for bribe-taking - even more susceptible to temptation. In May, evidence surfaced that officers in northern Rio had "rented" an armored vehicle to drug traffickers for the equivalent of roughly $300,000. In October, four officers, including a unit commander, were arrested after investigators found an illegal cache of marijuana and cocaine and more than a thousand rounds of ammunition for high-caliber guns at their station.
"The political and economic crisis, together with austerity measures, have had a dramatic impact on police operations and morale," said Robert Muggah, research director of the Rio-based Igarape Institute, which studies violence.
In Rocinha, gang warfare became so bad that the state called in the army for a week in September. Since then, heavily armed special police forces have patrolled the favela. On a recent afternoon, their black jeeps careened around a corner as tense officers trained machine guns on the hillside. A few streets away, several men - apparently drug traffickers - stood in the shadows, one of them clutching a pistol. Rocinha's neighborhood association insists that at least some of the police are on the payroll of one gang. With no single group solidly in command, and the police struggling to regain control, a crime wave has broken out. Homes are being burgled, businesses robbed.
"You watch the battles in the Middle East on TV. Here, it's worse," said Marcos Alfredo Guedes de Oliveira, whose Rocinha butcher shop was robbed at gunpoint recently for the first time in its 20-year history.
"Rocinha is at war."
- - -
Samantha was born and raised in Rocinha. While the favela was long home to drug gangs, they were relatively benevolent to most residents, training their ire on rival groups, informants and police.
For years, Samantha had a good job as a teacher's aide at a private preschool in Rocinha. But as security eroded and the economy crumbled, she noticed fewer kids in the school.
She was laid off in December 2016. Her husband, a mototaxi driver in Rocinha, saw his receipts drop, too. After months without work, Samantha had recently landed a job - standing for eight hours a day behind a coffee cart in a local park.
She wanted better for her girls. But on that October morning, as she waited in the emergency room, she wasn't even sure Nicolly would survive.
But she wasn't.
The rumor was false. In fact, a few hours after treatment, Nicolly was speaking again, "almost normally," her mother recalled.
The teenager came home a week later. One month after the shooting, she sat in the family home, barely speaking. She was startled by every loud noise. When fireworks went off - a method scouts use to notify traffickers of approaching police - she hit the floor.
Samantha wants to stay in Rocinha; it's what she knows. Nicolly doesn't.
Asked whether she felt safe, the teen said: "No, not anymore."
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)