Residents of a South African township near Johannesburg have set ablaze the homes of migrants they believe are illegally working in disused local mines.
There has been widespread anger after a large group of miners were accused of the gang rape of eight women last week.
Dozens of people are being held by police in connection with the assault but none have been charged with rape.
In recent years, poverty has been one of the drivers of xenophobic attacks.
Some believe – whether rightly or wrongly – that foreigners are the cause of many of their difficulties.
People in Kagiso say the foreign miners – known locally as Zama Zamas – are responsible for crime in the area. The sexual assaults last week in nearby Krugersdorp enflamed tensions and residents called for a demonstration.
On Thursday morning, police, both on the ground and in helicopters, fired stun grenades and rubber bullets to disperse angry mobs who were chasing the miners.
People armed with garden tools forced them to seek safety in old underground mine ventilation shafts.
A journalist from national TV station eNCA described seeing naked men being marched through the area and then beaten.
The police detained 22 men who had been targets of the violence in a move that may have been to prevent them being lynched.
There are reports that one person has been found dead, but it is unclear if the death is related to the protest.
Rocks, rubble and burning tyres have been used to blockade major roads in the township.People in Kagiso are now saying they fear reprisal attacks at night time. (BBC)