Audio By Carbonatix
South African President Jacob Zuma has visited a refugee camp in the port city of Durban after a fresh outbreak of anti-foreigner violence.
Mr Zuma told those who had fled the violence that it went against South African values and that he would bring it to an end.
He was jeered by some in the crowd who accused him of acting too slowly.
At least six people have died in xenophobic attacks in Durban, with violence spreading to other areas.
Migrants, mostly from other African states and Asia, have moved to South Africa in large numbers since white-minority rule ended in 1994.
Many South Africans accuse them of taking jobs in a country where the unemployment rate is 24%.
Mugabe 'disgust'
In a statement, Mr Zuma said: "These attacks go against everything we believe in. The majority of South Africans love peace and good relations with their brothers and sisters in the continent."
Then, as he visited the refugee camp in the Chatsworth area of Durban - after cancelling a trip to Indonesia - Mr Zuma said in a televised speech: "We are certainly going to stop the violence."
Addressing migrants who were planning to return to their home countries, he said: "Those who want to go home, when the violence stops you are welcome to return."
Mr Zuma said it was a minority that was causing trouble, but the BBC's Southern Africa correspondent, Karen Allen, says he was heckled by some in the crowd who branded his visit as too little, too late, adding that they were planning to leave South Africa altogether.
During the anti-immigration violence in the past fortnight, police have arrested 150 people for public-order related offences.
Several thousand foreigners have fled their homes to shelter in makeshift camps, and neighbouring Zimbabwe, Malawi and Mozambique have announced plans to evacuate citizens.
On Saturday, Zimbabwean President Robert Mugabe, speaking as chair of both the Southern African Development Community and African Union, said: "I would want now to express our sense of shock, disgust, as we abhor the incidences which happened in Durban."
Small groups attacking shops in several areas around Johannesburg on Saturday.

Police used rubber bullets to disperse looters in Alexandra, a township north of the city, with more than 30 people arrested.
Zulu King Goodwill Zwelithini has been accused of fuelling the attacks by saying that foreigners should "go back to their countries". However, he says his comments were distorted.
Official data suggests there are about two million foreign nationals in South Africa, about 4% of the total population. But some estimates put the number of immigrants at five million.
Latest Stories
-
Report says UK PM Starmer ready to quit, but source says he is still focused on the job
2 hours -
Bright Simons writes on the 320kg meth seizure linked to Ghana
3 hours -
Fastest World Cup to 100 goals in 68 years – are balls and breaks behind it?
3 hours -
Gakpo and Brobbey at the double as Dutch sink Swedes
4 hours -
Colombia’s escalating, brutal internal conflict is defining its presidential election
4 hours -
Israeli strikes kill six people in Gaza including Al Jazeera cameraman, officials say
5 hours -
King Charles to reveal personal tax bill for first time as monarch
6 hours -
Substitute Undav scores twice as Germany reach last 32 with comeback win
6 hours -
How does qualification for the World Cup knockout stage work?
7 hours -
At least 15 migrant bodies wash ashore in eastern Libya, sources say
7 hours -
‘Electoral Commission appointments must come from parliament’ – Kofi Bentil
8 hours -
iLotBet launches exciting iPhone 17 giveaway for World Cup season
8 hours -
Man found dead after alleged attempted attack on church in Sefwi Asafo
9 hours -
SIC Insurance launches electric vehicles to advance green transition agenda
9 hours -
NHIA CEO urges students to prioritise health insurance and wellbeing
9 hours