South Africa said Thursday it had temporarily closed its diplomatic missions in Nigeria following violence against South African businesses carried out in reprisal for attacks on foreign-owned stores in Johannesburg.
"After receiving reports and threats from some of the Nigerians we decided to temporarily close while we are assessing the situation," foreign ministry spokesman Lunga Ngqengelele said.
The embassy in Abuja and consulate in Lagos were shut on Wednesday, he said.
He told AFP the decision was made to protect employees after "groups of people" tried to force their way into the Lagos consulate.
"We will be monitoring the situation," said Ngqengelele. "When we see it necessary to open, we will re-open."
Nigeria stepped up security on Wednesday after xenophobic violence in Johannesburg triggered reprisals against South African businesses in Nigerian cities.
South African telecoms giant MTN temporarily closed its Nigeria outlets on Wednesday after protesters attacked South African-owned firms in a number of cities.
Foreign workers are often victims of anti-immigrant sentiment in South Africa -- the continent's second economy after Nigeria -- where they compete against locals for jobs, particularly in low-skilled industries.
Deadly attacks broke out in and around Johannesburg this week, leaving seven dead and dozens of shops destroyed, mostly foreign-owned.
More than 350 people have been arrested since Sunday.
Diplomatic ties soured between the continent's superpowers, with Nigeria boycotting the World Economic Forum on Africa in Cape Town this week, which was to be attended by its vice president, Yemi Osinbajo.
Nigeria also summoned the South African ambassador for talks on Tuesday and said it would be sending an envoy to convey "Nigeria's displeasure over the treatment of her citizens".
South Africa is a major destination for economic migrants from neighbouring Lesotho, Mozambique and Zimbabwe. But others come from much farther away, including South Asia and Nigeria.
Other African heads of state have also spoken out against the attacks.
"The incidents in South Africa concern us all," Senegalese President Macky Sall tweeted on Thursday. "I call for peace between countries and African people."
Chad's foreign ministry called on its citizens in South Africa to make contact with the embassy and avoid areas "where they could be targeted".
"(The ministry) asks the South African authorities to ensure the safety of all foreigners living in South Africa," it said in a statement.
Meanwhile, Nigerian billionaire Aliko Dangote -- reputedly Africa's richest man -- said violence between Africans hindered "our aspirations for a shared and sustainable prosperity."
"It is time for Africans to put Africa at the centre of its own development, by harnessing our entrepreneurial and intellectual skills," Dangote said.