(CNN) South Africa has temporarily closed its diplomatic missions in Lagos and Abuja, Nigeria, fearing reprisal attacks against its citizens, an official told CNN.

The closures follow outbreaks of violence earlier this week in South Africa. At least five people were killed and 189 arrested during xenophobic attacks and looting in Johannesburg, Pretoria and elsewhere.

Much of the violence targeted migrants from other African countries and foreign-owned businesses. The attacks prompted retaliatory looting in Nigeria, with South African-owned brands being targeted in looting at stores.

Government spokesperson Lunga Ngqengelele said officials in South Africa were currently assessing the threat and did not yet know when the diplomatic missions would reopen. The Nigerian arm of MTN, Africa's largest telecom company, closed all its stores until further notice after some of its outlets were targeted, the company said

The fallout from the outbreak of looting and violence that began on Sunday has been swift. Foreign nationals from countries including Zambia, Kenya, Ethiopia and Nigeria were targeted.

Read More