Violence against immigrants in South Africa has killed at least five people, resulted in attacks on businesses owned by foreigners and sent thousands to take refuge at temporary shelters.

A massive rally against xenophobia was held Thursday in Durban, the coastal city that has been the scene of much of the unrest. Migrants from Africa and South Asia have been the target of the violence, which was condemned by President Jacob Zuma.

The fighting in Durban left five people dead — two immigrants and three South Africans, CNN reported.

The charity Gift of the Givers told CNN that about "8,500 people fled to refugee centers or police stations this week because of the violence."

In Johannesburg on Thursday, foreign-owned shops were attacked and looted, the BBC reported, prompting some 200 people to take refuge at a police station.

The BBC adds: "Police fired tear gas and rubber bullets to disperse the looters and arrested 12 people. ... Police used rubber bullets to disperse a group of migrants in Johannesburg who had armed themselves with machetes for protection."

The unemployment rate in South Africa is 24 percent, and many in the country accuse foreigners of taking jobs. The violence, which has been widely condemned in South Africa, has been attributed to comments made by Zulu King Goodwill Zwelithini, who was quoted as saying foreigners should "go back to their countries." He says his remarks were misrepresented.

South African officials have apologized to their African counterparts for the violence.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.