RIO DE JANEIRO — One of the deadliest and least predictable phases in the global coronavirus crisis could begin as innocuously as this: A grandmother and her grandchild walking up a hill.

The boy, 9, was wearing a surgical mask, and the grandmother was scared. They were coming back from the hospital, trudging up a steep incline to their hovel in Rio’s storied Santa Marta favela. Sonia Maria de Oliveira feared life was about to get more difficult. The boy, believed to be Santa Marta’s first suspected case of the novel coronavirus, had just been ordered into 14 days of isolation.

But Oliveira worried whether that was even possible. Families in this hillside slum crowd into small homes stacked precariously on top of one another, as in a game of Jenga. Children stream in and out of homes, past fetid canals and down alleyways that are as much community living rooms as passageways.

It’s a challenge now confronting governments across the developing world, as the coronavirus moves into densely populated, poorer countries, where expansive urban slums with limited sanitation and medical care could accelerate disease transmission.

In Liberia, the 2014 outbreak of Ebola was fueled by conditions in the slums of Monrovia. In India, influenza propagates more rapidly in the poorest neighborhoods, which then feed back into the city at large. And in Brazil, even the mosquito-borne disease of Zika was far more concentrated in the favelas of the north, around the city of Recife.

Now in the global war against the coronavirus, analysts believe some of the most important battles will be fought in the poorest parts of the developing world, with far fewer tools and far less capacity for isolation than higher-income countries.

“The strategy being pushed in the United States and China and Korea, there is no strategy for that there,” said Madhav Marathe, a division director of the University of Virginia’s Biocomplexity Institute. “Once a disease enters a slum, it’s very hard to do social distancing. Once it’s in a slum, it’s very hard to protect them.”

It will also make it much harder to protect everywhere else, Marathe said. Studying influenza in New Delhi, he found that slums have a multiplying effect during an outbreak. It will be much more difficult for countries with extreme urban poverty to overcome the epidemic: There will be a feedback loop.

“The point is that they matter a lot,” he said. “They play a big role in concentrating and speeding up the disease.”

In a country such as Brazil, which has more than 1,000 confirmed cases as of Saturday — by far the most in Latin America — public health professionals say it won’t be long before the disease reaches the favelas, if it hasn’t already. The first confirmed cases were wealthy Brazilians who contracted the disease while traveling abroad. But the classes here mix so regularly — the poor work in wealthy households as doormen, laborers and domestic employees — that it’s soon expected to be everywhere. Rio state’s first reported coronavirus death was that of a 63-year-old maid who apparently caught it from her boss after the woman’s return from Italy.

“The people who brought this were the rich coming from vacations to Europe, but the people who will suffer much more will be the poor,” said Paulo Buss, one of Brazil’s leading public health doctors. “Unfortunately, I think it’s going to be there soon, and we will have big numbers.”

Officials are increasingly voicing alarm. Drastic ideas are being floated. The newspaper Estadão reported official talks of isolating infected favela residents on ships at sea. The favela news outlet Voice of the Communities reports the government plans to blast voice warnings into the slums.

Rio “is an extremely complex urban scenario,” Brazilian Health Minister Luiz Henrique Mandetta has said. “We have an enormous number of people in areas of social exclusion, in a more fragile system of health. Sao Paulo is stronger, but both will suffer greatly.”

For Wanda Guimarães, general coordinator of a Rio health service organization, it’s been like waiting for a hurricane to make landfall. Each day looks darker. More than 1.4 million people — nearly a quarter of Rio’s population — live in one of the city’s favelas. Many can’t afford to miss a single day of work, let alone weeks. People will continue leaving their houses, she said, regardless of government admonishments.

The storm’s about to hit.

Following nationwide protests urging government action this week, officials closed the land borders with eight neighboring countries. Sao Paulo will soon go into quarantine for 15 days. Rio is trying to seal itself from the rest of the country. A national emergency has been declared. The health minister is predicting the country’s health system will collapse within weeks.

Soon, researchers estimate, the country will have more than 5,000 cases.

“There certainly will be a lot of people dying,” Guimarães said. “The final result will be a lot of lives.”

Community health worker Inês Ferreira, making her rounds in the favela of Borel, has come to the same conclusion. The problems were already severe: poor health, a high rate of disease, limited education, overcrowding and — perhaps most urgently — scant understanding of the coronavirus.

Every day now is a race to inform people.

“Some people are beginning to understand that we have to stay in the house,” Ferreira said. “But there are so many health problems. The children don’t have nutrition. The old people don’t have nutrition . . . We believe it will kill a lot of people.”

Foreboding is now settling over communities, which spill across Brazil’s hilly urban landscape in splashes of orange and gray, as the gap between what needs to be done and what can be done becomes increasingly stark.

“Yesterday we didn’t have water,” said Raull Santiago, a community activist in Complexo do Alemão. “Social isolation is nearly impossible. Families of six live in one-bedroom houses . . . The rich people have bought up all of the hand sanitizer. We can’t even take the minimum steps to do this.”

Rocinha — the biggest favela in Brazil, with an estimated population of 70,000 — has announced it wants to ban foreign visitors to try to protect the community. The same goal has been taken up in Santa Marta, where on a recent overcast morning the coronavirus was the only topic anyone wanted to talk about.

“Houses are very close to each other,” said Lorrana Ismerim, speaking along a tight passageway shooting upward. “There’s not much air circulation.”

Nearby, José Mario Hilário said he’d only just recovered from tuberculosis. “Diseases cause death here,” he said. “We have to worry.”

It was the only thing that Oliveira, the grandmother, felt she could do right now. When her grandson developed a dry cough and a high fever, she feared the worst. At 50, she understood she was at greater risk but would never isolate herself from him.

On Tuesday morning, she took him to the doctor at the base of the hill. She learned he might have the coronavirus. Now she was trying to put into words what it meant. And what she could do about it.

“We live in a small house,” she said. “It wouldn’t even be possible to isolate him. I am afraid.”

She turned away. With a mask now across her face, too, she took the boy up the winding passageways, to the top of the mountain.