Five people have been killed in a surge of xenophobic violence in South Africa, police said on Tuesday, as President Cyril Ramaphosa vowed to clamp down and the African Union, Nigeria and Zambia condemned the attacks.

Hordes of people, some armed with axes and machetes, gathered in Johannesburg's central business district for a third day of unrest directed against foreigners, hours after mobs burned and looted shops in the township of Alexandra, prompting police to fire rubber bullets to disperse them.

Five deaths, most of them South Africans, have been reported, police said, adding that 189 people had been arrested.

In a video address broadcast on Twitter, Mr Ramaphosa said attacks on businesses run by "foreign nationals is something totally unacceptable, something that we cannot allow to happen in South Africa."

"I want it to stop immediately," said Mr Ramaphosa, adding that the violence had "no justification."

Our security forces are on high alert. Whilst in no way, can we take away the sense of deep loss and unbearable pain you experience, as a country we commit ourselves to continue to work tirelessly to building the kind of South Africa, where indeed womxn and children will be safe. pic.twitter.com/ZoQSziiuPM — Cyril Ramaphosa 🇿🇦 (@CyrilRamaphosa) September 3, 2019

Sporadic violence against foreign-owned stores and enterprises has a long history in South Africa, where many locals blame immigrants for high unemployment.

The country is a major destination for economic migrants from neighbouring Lesotho, Mozambique and Zimbabwe. Others come from much farther away, including South Asia and Nigeria, Africa's most populous country.

Gavin Booldchand, who lives in Coronationville, a low income suburb west of Johannesburg, said he witnessed one of the killings on Tuesday, which was blamed on a Pakistani store owner.

"The owner of the shop shot him straight into the face," Booldchand told AFP. "He didn't have to shoot the guy like that you know.

"People are taking our jobs and stuff (and) it is our country after all."

Getty

This week's assaults appear on a greater scale than in the past, although the full details remain unclear.

"They burned everything," Bangladeshi shop owner Kamrul Hasan, 27, told AFP in Alexandra, adding that his shop gets attacked every three to six months.

"All my money is gone. If the (South African) government pays for my plane ticket, I will go back to Bangladesh," he said.

The violence and looting of shops occurred in Johannesburg and surrounding areas.

Similar incidents occurred in the capital Pretoria on Monday, when local media reported shacks and shops burning in the Marabastad - a central business area largely populated by economic migrants.

AAP

Nigerian anger

Nigeria summoned its South African ambassador to express "displeasure over the treatment of her citizens" and said it would dispatch a special envoy.

Several Nigerians used social media to call for a boycott of South African companies, including telecoms provider MTN, satellite television service DSTV and retailer Shoprite.

Separately, African Union chairperson Moussa Faki condemned the violence "in the strongest terms" but said he was encouraged "by arrests already made by the South African authorities".

1/3: I condemn in the strongest terms, the incidents of violence against nationals of fellow African countries in #SouthAfrica, including the looting and destruction of their property. My full statement here: https://t.co/lwDmocBAij — Moussa Faki Mahamat (@AUC_MoussaFaki) September 3, 2019

Zambia has cancelled an international friendly football match which was slated for Lusaka next weekend against South Africa.

"This is because of the security concerns, you never know what can happen," Football Association of Zambia (FAZ) secretary general Adrian Kashala, told AFP. "We want to be sure of the security of (the) visiting team".

The attacks on foreign stores began a day after South African truckers started a nationwide strike on Sunday to protest against the employment of foreign drivers. They blocked roads and torched foreign-driven vehicles mainly in the southwestern KwaZulu-Natal province.

Deputy President David Mabuza condemned all attacks on foreign nationals.

"We are a nation founded on the values of ubuntu (humanity) as espoused by our founding father, President Nelson Mandela... we should always resist the temptation of being overwhelmed by hatred," he said in Cape Town on Tuesday.

Sickly economy

The violence erupted ahead of a meeting of the World Economic Forum on Africa in Cape Town, where hundreds of political and business leaders will gather for three days from Wednesday.

David Makhura, the premier of Johannesburg's Gauteng province, said rioting was not a solution.

"This issue can be dealt with without resorting to xenophobia," Mr Makhura told reporters. "There is no country that does not have foreign nationals."

Getty

Opposition parties pinned the blame on the ruling African National Congress.

"South Africans are scared and lack real hope for the future," said Mmusi Maimane, leader of the Democratic Alliance, South Africa's official opposition. "We are seeing economic and social collapse in action."

Mr Ramaphosa took office after elections in May that he won on a platform of reviving the country's economy and boost employment.

But in July, the national statistics office said joblessness had reached 29 per cent -- the highest since the country's quarterly labour force survey was introduced 11 years earlier.