President Cyril Ramaphosa says two of the victims were foreigners who were killed during a wave of attacks on foreign-owned stores followed by apparent reprisal attacks in Nigeria.
South Africa's President Cyril Ramaphosa said on Thursday at least 10 people have been killed, two of them foreigners, in a wave of riots and attacks.
"Over the past few days our country has been deeply traumatised and troubled by acts of violence and criminality directed against foreign nationals and our own citizens," Ramaphosa said in a televised address.
"People have lost their lives, families have been traumatised ... We know that at least 10 people have been killed in the violence. Two of whom were foreign nationals."
Also on Thursday, South Africa said it temporarily closed its diplomatic missions in Nigeria as the country came under fire for a wave of attacks on foreign-owned stores.
Dozens of shops were destroyed or looted in xenophobic violence in and around Johannesburg this week, triggering angry demonstrations in several African countries.
Foreign workers are often victims of anti-immigrant sentiment in South Africa — the continent's second-biggest economy — where they compete against locals for jobs, particularly in low-skilled industries.
Appeals for calm
African nations have appealed for calm while urging their nationals in South Africa to exercise caution.
Nigeria, the source of many of the workers in South Africa, has stepped up security after apparent reprisal attacks, while violence also flared in the Democratic Republic of Congo on Thursday.
In Nigeria, South Africa's embassy in the capital Abuja and consulate in the economic hub of Lagos were shut on Wednesday.
"After receiving reports and threats from some of the Nigerians we decided to temporarily close while we are assessing the situation," South African Foreign Ministry spokesman Lunga Ngqengelele said.
Ngqengelelee told AFP the decision was made to protect employees after groups of people tried to force their way into the Lagos mission.
"We will be monitoring the situation," he said. "When we see it necessary to open, we will reopen."
South African telecoms giant MTN temporarily closed its Nigeria outlets on Wednesday after protesters attacked South African-owned firms in a number of cities.
And in another outbreak on Thursday, angry crowds in DR Congo's second largest city Lubumbashi smashed the windows of the South African consulate and looted South African-owned stores.
Also on Thursday, Nigeria pledged to "work as brothers" with Pretoria.
"Nigeria does not seek an escalation of the ongoing situation," a senior aide to Nigeria's President Muhammadu Buhari, told reporters on condition of anonymity.
"We will work with South Africa to find solutions to their problems which have become our own problem. We will work as brothers," the aide said.
'Home for all'
President Cyril Ramaphosa condemned the violence, but acknowledged, "We face a huge challenge."
"Taking action against people of other countries is not right," he said. "South Africa is home for all. We are not the only country that has become home for people fleeing."
The nationality of the victims has not yet been determined.
The violence in South Africa had largely fizzled out on Wednesday with only a handful of looting incidents reported by police, mainly targeting shopping centres.
A group of residents late Wednesday confronted a mob caught breaking into a local retail store in the northern township of Katlehong.
"We are happy that the law-abiding members of the community are becoming frustrated about these criminals who are targeting businesses in their areas," provincial commissioner Elias Mawela said in a statement on Thursday.
More than 420 people have been arrested since Sunday.
In 2008, xenophobic violence left 62 people dead, while in 2015, seven were killed in attacks in Johannesburg and Durban.
The latest violence has soured ties between the continent's biggest powers, with Nigeria boycotting the World Economic Forum on Africa in Cape Town this week.
Nigeria also summoned Pretoria's ambassador on Tuesday and said it would send an envoy to convey "Nigeria's displeasure over the treatment of her citizens."
The government said the head of private Nigerian airline Air Peace Airlines had offered to fly Nigerians home for free.
AFP was not immediately able to confirm this with the company.
South Africa is a major destination for economic migrants from neighbouring Lesotho, Mozambique and Zimbabwe. But others come from much farther away, including South Asia and Nigeria.
Several Nigerian-owned shops and properties have been destroyed, Foreign Minister Geoffrey Onyeama said, but said no Nigerians had been killed.
"On social media, there is a lot of stories going around of Nigerians being killed, jumping off buildings and being burnt," he told reporters on Wednesday. "This is not the case."
South African police have also condemned the "abuse of social media ... since the flare-up."
'Concern us all'
Other African heads of state have also spoken out against the attacks.
"The incidents in South Africa concern us all," Senegalese President Macky Sall tweeted. "I call for peace between countries and African people."
Chad called on its citizens in South Africa to make contact with the embassy and avoid areas "where they could be targeted."
"[The ministry] asks the South African authorities to ensure the safety of all foreigners living in South Africa," it said in a statement.
The Republic of Congo also advised its citizens to exercise caution.
Nigerian billionaire Aliko Dangote — reputedly Africa's richest man — said violence between Africans hindered "our aspirations for a shared and sustainable prosperity."
"It is time for Africans to put Africa at the centre of its own development, by harnessing our entrepreneurial and intellectual skills."