The army has been deployed to try to put a stop to the attacks
The secretary general of South Africa's governing ANC has called on party members to form local committees to combat violence against foreigners.
Gwede Mantashe says that they should work to "take the streets back from criminals", whilst giving support to the police and help to the victims.
The unrest has now spread to Cape Town, with people assaulted and shops looted.
More than 40 people have died and some 15,000 people have sought shelter since the violence began two weeks ago.
On Thursday, troops were deployed to quell attacks - the first time soldiers have been used to stamp out unrest in South Africa since the 1994 end of apartheid.
In a statement on the African National Congress (ANC) website, Mr Mantashe described the violence as "a shameful pogrom".
"Ill informed and angry with people whom they perceive to be robbing them of their right to services," he said. "Is this the truth? The same mob that accused people of being criminals acted in the most obscene of criminal ways."
The screams of the burning Mozambican still haunt me... I have never seen such barbarism
"There is no room for this behaviour in our country ever. There is no reason that compels us to behave in the atrocious manner."
Mr Mantashe reminded South Africans of their link to the rest of the continent ahead of Africa Day celebrations on Sunday.
"On Sunday we will wake up in this country and celebrate the victories our forebears have had over colonialism and apartheid," Mr Mantashe wrote in the party's weekly newsletter.
"Many of us... will think of the kindness we received in the poorest communities of Angola, Mozambique, Zimbabwe, Zambia, Tanzania, Nigeria and many other African states."
Anti-apartheid fighters in the ANC were given shelter in other African countries, some of which suffered collective punishment as a result, he recalled.
Meanwhile ANC Youth League President Julius Malema condemned the fact that youngsters appeared to be some of the ringleaders of the attacks, often using the name of the party and singing revolutionary songs whilst carrying out attacks.
"They (the youth) must rise against this thuggery and hooliganism and claim back their communities," he said.
Mr Malema said the government had not done enough to stop what it called "anarchy" and said swift and decisive action was needed from the country's law enforcement agencies.
The leader of South Africa's official opposition, Helen Zille, says the events of the past two weeks have shocked and shamed the nation.
Ms Zille, head of the Democratic Alliance, says in her weekly newsletter that President Thabo Mbeki has been conspicuous by his absence, not even visiting the affected areas to see for himself what is driving the violence.
She said the president should be actively campaigning in the country's trouble spots and preaching a message of tolerance.
Meanwhile, the authorities in Malawi says they have begun evacuating hundreds of Malawians from South Africa.
Officials said a task force had been set up to return up to 850 Malawians, who had been affected by the violence in South Africa.
The attacks in Cape Town, the hub of South Africa's tourism industry, broke out during a meeting called to prevent anti-foreigner violence in the Dunoon township, 25km from the city centre.
John, a Malawian at the Dunoon meeting, said it disintegrated and foreigners started fleeing as groups began to loot Somali-owned shops.
Plain clothes police open fire on looters in Cape town
"We feared for our safety. They're just killing everyone - they start beating you when they find out you're a foreigner," he told the BBC, adding that he was returning home as soon as possible.
Thursday night's unrest prompted some 500 people, including Somalis, Mozambicans and Nigerians, as well as Zimbabweans to flee their homes, some seeking refuge in police stations.
The BBC's Mohammed Allie in Cape Town says Somali shops were looted overnight and one Somali killed and six others injured.
He says there have been shack-to-shack searches for foreigners and some local residents have begun flying the South African flag outside their homes.
We are extremely concerned about the situation on the ground - you must remember that 67% of the tourists coming into South Africa are mainly African
Moeketski Mosola, head of South Africa Tourism
There have also been new attacks in Strand, east of Cape Town, Durban and North-West province, where three people, reportedly from Pakistan, were stabbed and dozens of Mozambican and Somali nationals displaced.
There are fears that the unrest could have longer-term consequences for the country.
Moeketski Mosola, head of South Africa Tourism, told the BBC the government was alarmed by the situation, especially as the country was preparing to host the football World Cup in 2010.
"We are extremely concerned about the situation on the ground - you must remember that 67% of the tourists coming into South Africa are mainly African," he told the BBC's World Tonight programme.
World Cup pressures
Danny Jordaan, the chief executive of the 2010 World Cup Local Organising Committee, has condemned anti-immigrant violence.
"We ask that every action must be taken to stop inflicting on displaced people further displacement," Mr Jordaan said.
However, he insisted that the unrest would have been quelled by the time the tournament took place.
Our correspondent says the police have beefed up their presence in other Cape Town trouble spots as looting spread on Friday.
Cape Town first witnessed xenophobic attacks two years ago when the Somali community - especially those who owned shops - were targeted and some murdered.
Durban also witnessed unrest earlier this week but most of the violence has been in the Gauteng region around Johannesburg, which is now reported to be relatively quiet.
Are you in South Africa? Have you witnessed or been caught up in these clashes? If you have any information you would like to share with the BBC you can do so using the form below:
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.