LIMA, Peru — Mayumi Matto ventures from her coronavirus­induced confinement in the home she shares with 15 family members just twice a week.

Matto, 28, joins the queue outside the market in Puente Piedra, a gritty suburb on the edge of the Peruvian capital, at 7 a.m. It’s a scene that has grown familiar around the world: Only those wearing masks are allowed to enter. Security guards enforce a one-out, one-in policy. Waiting customers are careful to stand apart from one another.

But once inside the market, everything changes.

“It’s packed,” Matto says. “It’s impossible to move around without bumping into people. Everyone is in a hurry to get in and out as quickly as possible, without getting infected. Security try telling people to keep their distance, but it’s no use.”

Matto’s experience is typical in Peru, where many of the 31 million citizens buy much of their food in informal street markets that remain severely overcrowded and where the concept of personal space is among the most limited in the world. Those challenges help explain why the number of coronavirus cases reported in the Andean nation is soaring, despite an early and decisive response against the pandemic.

Video shows group of Americans trying to evacuate to the U.S. amid the coronavirus outbreak in Peru. (Daniel Voznyarskiy)

Confirmed cases here jumped from 7,519 on Sunday to 13,489 on Friday. In Latin America, only Brazil, with a population seven times greater, has more. An outbreak that started in Lima has spread across the country, even reaching indigenous communities in the Amazon.

“The government has got a lot of things right,” says Ciro Maguiña, an epidemiologist and vice dean of Peru’s medical association. “But its approach has been hospital-centric — are there enough beds and ventilators? — rather than community-centric. There needs to be a lot more work in the communities to prevent transmission.”

The rise in confirmed cases is partly attributable to expanded testing. With the arrival of new kits, the government of President Martín Vizcarra moved this week from testing about 1,000 people per day to 10,000.

But the people in the new cases will have been infected during one of Latin America’s strictest lockdowns, now in its fifth week. Private vehicles are all but banned from the roads, people may leave their homes during the day only to buy food or for medical reasons, and there’s a curfew from 6 p.m. to 4 a.m. each night.

But there are some conditions that quarantines can’t defeat. Many poor Peruvians live in cramped, unsanitary dwellings. Nearly a million in Lima alone lack running water. And cultural practices aren’t helping, either. Peruvians are tactile; a 2017 study showed only Argentina had a more limited sense of personal space. Peruvians typically stand several inches closer to strangers than would Americans.

Some Peruvians, meanwhile, have been flouting the lockdown. So far, nearly 60,000 people have been arrested for violating the rules. They include police officers caught drinking beer together at banned private gatherings. In one notorious case, an officer in the Cusco region faked symptoms of covid-19, the disease caused by the coronavirus, to get sick leave and was then caught drunk in the town square.

But single mothers have also been detained, mainly for violating a controversial gender-based requirement for men and women to go out on alternate days. That measure, aimed at encouraging households to designate a single shopper, was quickly scrapped.

Peru’s upward trend could be a harbinger of things to come in other developing nations with poor sanitation, weak public institutions and frayed trust in authority.

Vizcarra’s handling of the pandemic has been widely praised here. He gives daily television addresses similar in style to those of New York Gov. Andrew M. Cuomo. His approval rating has hit nearly 90 percent, according to a poll conducted by Ipsos on WhatsApp.

Despite the jump in confirmed cases, Vizcarra insists the underlying trend is starting to slow.

The government has launched a $26 billion relief package, equivalent to 12 percent of the gross domestic product, including direct payments to individuals. Yet many are being left out. They include Matto. Before the outbreak, she earned around 45 sols a day — around $13 — collecting fares on a combi, one of the ramshackle minibuses that serve as public transport here. Now Matto, her husband and their 9-year-old son are living off savings.

The strain is starting to show. This week, a convoy of hundreds of desperate families left Lima on foot to trek eastward up the hair-raising Central Highway to return to homes in the Andes. They were met by security forces; after an initial standoff, authorities persuaded them to take coronavirus tests and are now attempting to arrange transport.

Forty-two of the migrants tested positive. They are now being quarantined.

Peru is also home to an estimated 1 million Venezuelan refugees, often working low-paying informal jobs that have evaporated in the last month.

“There is a lot of hunger,” says Garrinzon González, who runs the Venezuelan Union in Peru, a self-help group for immigrants. “I can hear the desperation in their voices when they call me. There are people getting by with boiling water with sugar. It is terrible.”