The economic and political crisis in Zimbabwe has caused an influx of migrants into South Africa.
Many people from Zimbabwe, and other countries, such as Malawi and Mozambique, have headed for Alexandra township near Johannesburg, where around 600,000 people live.
But this has caused some local resentment and on Sunday, mobs attacked the migrants, leaving two people dead and about 40 injured.
Hundreds of migrants are now living in fear and despair after the attacks.
Police arrested 15 people among the locals, who accuse the migrants of taking jobs and being involved in crime.
A clean-up operation began the day after the riots.
The latest wave of anti-foreigner attacks has caused growing concern in the "rainbow nation", where some of the country's poor are worse off than they were before the transition to majority rule.
Migrants who escaped Alexandra to stay with friends and relatives in the township of Diepsloot, near Pretoria, were attacked again. Police sealed off parts of Diepsloot to try to restore order, using armoured personnel carriers.