KRUGERSDORP, South Africa — As South Africa’s health experts watched the coronavirus race through Europe and begin to seed itself in their country, they made a pivotal decision.

Instead of waiting for sick people to start swamping their health system, potentially overwhelming it, they mobilized tens of thousands of medical workers — and brought care to the people instead.

More than 28,000 health-care workers have spread out across South Africa’s nine provinces. Some go door to door, taking down people’s travel histories, temperatures and other risk factors. Others, especially in dense, poor communities known as townships, set up pop-up clinics where turnout has been high.

“Only South Africa has done that,” said Salim Abdool Karim, a member of the country’s pandemic task force, referring to the scale of the effort.

Two million South Africans — out of a population of 57 million — have been screened this way, according to the health ministry. Tens of thousands have been tested who may not otherwise have been. South Africa has more than 3,400 confirmed cases — the highest number in Africa — but its government considers that a result of aggressive testing. As of Tuesday, more than 125,000 people had been tested.

Other countries, such as China, Cuba, Ethiopia and India, have deployed large numbers of health-care workers to conduct door-to-door checkups or screenings, but South Africa is the only country to do so nationwide, and with the intention of gathering data about who is most at risk and who should be tested.

In a country where many don’t have their own cars or money to pay for public transportation, many here are grateful for the door-to-door checkups and mobile clinics.

“They didn’t sit and wait for corona to come to them. They went and faced it head-on,” said Eunice Ratlhagane, 55, who is unemployed and lives in a township in Krugersdorp, just outside Johannesburg, South Africa’s biggest city.

Around her, however, was a scene that an aggressive health-care response can’t fix. Despite an ongoing lockdown, in which people are supposed to leave home only for essential reasons, rows of shops were open. Kids played tag. Street traffic was bustling.

The high number of patients at the mobile clinics demonstrates South Africans’ desire to be part of the solution, but the inability of many to stay home reflects widespread poverty.

“Right now I need to make sure my stock sells out, and I have enough to feed my family,” said Peter Pooe, 55, who owns a spaza shop, a South African version of a corner store. He supports the government’s strategy because he thinks many are underestimating the pandemic.

“But I don’t know if it will work, as many people here are less concerned with covid than wanting to just survive,” he said.

A quarter of South Africans live in townships where running water is intermittent, often built right up against sparkling estates with swimming pools. It is one of the most unequal societies in the world. In Swaneville, the township where Ratlhagane and Pooe live, they have to fetch water from a tank, which makes it difficult to have enough for cooking, cleaning and washing their hands. Many live in rooms with many other people.

Health experts have cautioned that in such countries, lockdowns may cause more harm than good, and may even lead to societal unrest. That makes extensive testing, monitoring and quarantining even more essential. South Africa is working toward testing 30,000 people every day by the end of this month, according to the National Health Laboratory Service.

“We are proactively screening and recommending testing to have an accurate picture of what is happening on the ground and to get a sense of geographical mapping of the spread of the virus,” said Lwazi Manzi, a health ministry spokeswoman.

For now, South Africa’s curve does not appear to be growing exponentially, as many had feared. Cases rose quickly for about 10 days, but new ones haven’t exploded since the lockdown was imposed and the mobile health teams were deployed. Hospitals are easily coping with the cases they have.

“What South Africa has done is impressive, absolutely,” said John Nkengasong, the director of the Africa Centers for Disease Control and Prevention. “We should stop being afraid of covid and do things that work. That’s what they did. They are getting data, which is what will be required to unlock the country.”

Members of South Africa’s pandemic task force praised President Cyril Ramaphosa for heeding their warnings early on, even though the lockdown would have enormous economic costs in a country already in recession. He also earned plaudits for nationally televised speeches in which he minced no words communicating the seriousness of the virus, and called on South Africans to sacrifice the present for the future.

Speaking on Tuesday night, Ramaphosa announced a $26 billion economic relief package, which he called an “extraordinary coronavirus budget,” making up about 10 percent of the nation’s gross domestic product.

“Millions of South Africans in the informal economy and without employment are struggling to survive,” he said, while rolling out significant increases to social welfare, child support, wage subsidies and unemployment grants.

Besides poverty, South Africa is also home to a fifth of the world’s HIV and tuberculosis cases. The collision of those older pandemics with this new one has put health experts on alert, given the high likelihood that serious immune and respiratory diseases will lead to higher death tolls from covid-19.

Experience with those pandemics gives South Africa a leg up in some ways, said Karim, the task force member who is also one of the world’s foremost experts on HIV. South Africa has been using a testing system for tuberculosis called GeneXpert, which has also now developed a covid-19 test that the U.S. Food and Drug Administration approved last month. South Africa will receive those tests in the coming days.

“Screen, test, diagnose, contact trace, isolate, treat — it’s the same basic elements for HIV, TB and covid,” he said. “The only trouble with covid is we don’t have treatment.”

In Swaneville, people just trying to get by knew that the lack of treatment wasn’t the only trouble. Even if they took the virus seriously, they could see others, sitting together, sharing a beer. At the mobile clinics, nurses said they used to be mocked, as many viewed the disease as afflicting only rich people who could afford to travel abroad.

Turnout at the clinics on Sunday was high, however, and the nurses said they thought the public was starting to see things their way. People were feeling a sense of camaraderie, sharing the experience of both poverty and the pandemic.

“I didn’t have water last week, but my neighbor gave me [some]. We must just share and remember: umuntu ngumuntu ngabantu,” said Pooe, using a phrase from a South African language often translated as “I am because we are.”

Bearak reported from Nairobi.