South African President, Cyril Ramaphosa.

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, South Africa's President Cyril 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 Ramaphosa, adding that the violence had "no justification."

I condemn the violence that has been spreading around a number of our provinces in the strongest terms. I’m convening the ministers in the security cluster today to make sure that we keep a close eye on these acts of wanton violence and find ways of stopping them.

The people of our country want to live in harmony; whatever concerns or grievances we may have, we need to handle them in a democratic way. There can be no justification for any South African to attack people from other countries.

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."

'They burned everything'

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.    

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".

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," Makhura told reporters. "There is no country that does not have foreign nationals."

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."

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 percent -- the highest since the country's quarterly labour force survey was introduced 11 years earlier.