South African police have fired rubber bullets and a stun grenade to disperse a gang of African immigrants who had armed themselves with machetes in a run-down district of east Johannesburg.

The country has been hit by a wave of violence against immigrants in the last two weeks. The foreigners have complained about a lack of protection and some have started to arm themselves.

Dozens of South African anti-immigrant protesters gathered to confront the vigilante group but they were also dispersed by police.

At least four people have been killed in the unrest that started two weeks ago in Durban, a major port on South Africa's Indian Ocean coast where further clashes broke out on Thursday.

Violence flared days after Zulu King Goodwill Zwelithini said in remarks reported by local media that foreigners should leave South Africa.

He has since said his comments were misinterpreted.