More than 5,000 South Africans took to the street to protest against attacks on foreigners.
Demonstrators in Durban shouted “down with xenophobia” and called for a united Africa.
With close to a quarter of the population unemployed, the jobless are blaming foreigners for taking all the work. The rise in tension has led to a spate of killings that has left at least four dead.
Prime Minister Jacob Zuma called for calm and described the killings as “shocking”.
“I think this now must stop, because we cannot continue killing one another. What is happening in our country is not acceptable,” he told state broadcaster SABC.
Authorities have erected safe camps for fleeing immigrants whose shops were looted and burnt.
The violence started in Durban and spread to other parts of the country. In Johannesburg, riot police had to use rubber bullets and tear gas to disperse crowds while dozens sought refuge in police stations.
Many are putting the rise in xenophobic sentiment down to the Zulu king. In a video posted online, a translation of Goodwill Zwelithini’s words appears to paint a picture of foreigners as housebreakers, thieves and child rapists.
The king denies the claim and says his words have been taken out of context.