Thousands of angry South African protesters hunted down miners without permits, sealing makeshift shafts and burning houses, after the mass rape of eight women last week west of Johannesburg.
Armed with machetes, golf clubs and hammers, mobs of residents on Thursday moved from one area to another on the fringes of the town of Kagiso, trying to smoke out miners operating illegally in informal shafts.
Informal miners commonly known as "zama zamas" -- largely undocumented foreigners -- were believed likely behind the attack on July 28.
Police kept a distance and fired stun grenades from a helicopter to disperse the crowds.
Later in the evening, authorities said the situation had stabilised and 29 undocumented people had been arrested on charges of illegal immigration.
Police said a murder and public violence investigation was opened after the body of a man was found near the area in the morning.
It was not immediately clear if the death was linked to the protests.
Cholera-hit South African town blames government for deadly outbreak
South Africa enters the luxury olive oil market
S'Africa: Amid fears of black out, electricity minister says work in top gear to stop load shedding
South Africa's para surfers dream of competing in the Paralympics
Ugandan LGBTQ activist plans to return home, despite fear of arrest
South Africa: Ex-Convicts face joblessness