At least 62 people have been killed in attacks over the last three weeks on African immigrants around the country.
Poor residents accuse migrants of stealing their jobs, with a large Somali community targeted in Cape Town, South Africa's second biggest city and top tourist attraction.
"We are African. We are from this soil. I am not a foreigner ... and this soil is Africa," Abdul Kadir Karakoos, a Somali leader in Cape Town, told reporters, adding his community had buried 600 countrymen killed in anti-immigrant violence since 2002 in South Africa.
Protesters called for justice and asked for help from Nelson Mandela, anti-apartheid icon and South Africa's first black president.
Tens of thousands of immigrants have been forced to take refuge at temporary shelters around the country, with at least 50,000 Mozambicans and Zimbabweans opting to return home because of the unrest, which has subsided.
Thousands of refugees housed in tents face freezing temperatures at night, as well as the threat of disease.
The violence started in a Johannesburg township on May 11 before spreading to other cities, with mobs wielding machetes and axes to force migrants from their homes.
"We can't stay here. We need U.N. help," read one of the placards carried by Somali traders.
HELP
The United Nations and various non-governmental organisations have pledged to help South Africa.
International medical humanitarian group, Doctors Without Borders, said facilities for displaced refugees were inadequate and added to the trauma they had suffered.
"After living in unacceptable conditions for up to three weeks, the people displaced are now being relocated by the South African government, without proper access to information about their rights and options, to sites that are unprepared and insecure," the group said in a statement.
"They say they are being treated like animals."
The South African government, criticised for its initial slow response, said more than 1,300 people have been arrested in connection with the violence, which the state says is being driven by criminal elements.
"The perpetrators. They must bring them to book. There must be justice and there must be social integration," said Mahad Omar Abdi, a member of the Western Cape-based Somali management crisis team.
The violence, which has shattered South Africa's image as a welcoming home for asylum seekers, is being stoked by soaring food and fuel prices and competition for jobs and housing.
Nationally, Zimbabweans and Mozambicans have been most affected.
Zimbabweans, whose country is in economic meltdown, are the largest immigrant group, accounting for 60 percent of the 5 million migrants living in the country of about 50 million.