It's 6 a.m. and Tholakele Nkwanyana is one of the first people to arrive at the Diepsloot public health clinic in Johannesburg, not to seek medical attention but to stop foreigners from getting care.

She and fellow members of South Africa's anti-immigrant group Operation Dudula — which means “to get rid of by force” — are dressed in military-style fatigues as they block the entrance and demand to see patients' identity documents.

Mothers carrying children and others who are sick are turned away and told to go to private hospitals, which unlike public ones aren't free.

Similar scenes have played out at government-run clinics across South Africa's most populous province, Gauteng, as healthcare becomes the new battleground in the country's long and painful debate over immigration.

The Johannesburg High Court has ordered Operation Dudula to stop harassing migrants. The group says it will appeal.

"Our operation focuses on putting South Africans first," Nkwanyana told The Associated Press.

"The problem we have is the high influx of foreigners and the medication is limited. South Africans have to go back because there's no medication."

Africa’s most developed economy, which hosts world leaders this week for the Group of 20 summit, attracts migrants from neighboring Zimbabwe, Mozambique and Lesotho and as far away as Nigeria and Ethiopia.

In the year ending March 31, the Department of Home Affairs deported 46,898 migrants who had entered South Africa without documentation, an 18% increase from the previous year.

Operation Dudula emerged a few years ago, and its visibility has grown as mostly young Black South Africans take part.

It's not clear how many members the group has. Its actions have included closing down foreign-owned shops and blocking the children of foreigners from entering public schools.

Operation Dudula members assert that migrants entering without documents are taking jobs from South Africans, who face one of the world's highest unemployment rates at over 31%.

South Africa has seen sometimes deadly waves of such sentiment. In 2008, 68 people were killed in attacks on foreigners across the country.

But the focus on denying them health care is new, along with Operation Dudula's organized structure.

The group has regional leaders and participates in news conferences and debates, and it has hinted at forming a political group.

South Africa's government has condemned Operation Dudula's actions and insists that the law guarantees health care for everyone, including foreigners in the country illegally.

Health Minister Aaron Motsoaledi and others have met multiple times with Operation Dudula and the government has posted security at public clinics, but police are overstretched in a country where the crime rate is high.

In August, three Operation Dudula members were arrested after going into a maternity ward in Soweto and demanding that patients produce identity documents. Nurses called police. They have since been released on bail.

The South African Human Rights Commission, which has sharply criticized Operation Dudula's actions, has said South Africa is following a global rise in anti-immigrant sentiment.

South Africa spends 8.5% of its gross domestic product, or about $15 billion, on health care, higher than everything but education. And yet it has overcrowded hospitals, shortages of medication and poor management.

But many people in other African countries see South Africa as a relatively attractive destination.

South Africa had an estimated 2.4 million foreign nationals in 2022, about 3.9% of the population, according to official statistics, with no breakdown of those there legally or illegally.

That was up from the estimate of over 958,000 in the census of 1996.

Operation Dudula's actions have drawn attention in Zimbabwe, where a lawmaker during one recent Parliament debate brought up the group and suggested that the government do something about the rising tensions — like pay for its citizens' treatment in South Africa.

Justice Minister Ziyambi Ziyambi replied that the government would not.

Meanwhile, Zimbabwe’s political elite largely seek treatment abroad, including in South Africa.