Private Nigerian airline Air Peace volunteered to fly people for free back to the commercial capital Lagos. At least 320 Nigerians were expected to fly out on Wednesday, while a second flight departs on Thursday.
At least 640 Nigerians signed up to return home.
The repatriation came after riots in Pretoria and Johannesburg killed at least 12 people as 1,000 foreign-owned businesses were targeted. The violence sparked an international outcry and calls for a boycott of South Africa.
Pastor Ugo Ofoegbu has lived in South Africa for close to two decades. He was sending his wife and three children back to Nigeria.
South African violence: Nigeria recalling top diplomat
“My family is not safe here,” Ofoegbu told Al Jazeera.
Reprisal attacks in Nigeria last week forced South African business to shut down, while the South African embassy in Lagos temporarily closed its doors over safety concerns.
Not just Nigerians
More than 700 people from other countries, including Malawi and Zimbabwe, have sought refuge in community centres. Many left their homes with little more than a few bags when the violence began.
One is Mozambican Oscar Setuve, who registered for a temporary travel document to return home. He has lived in South Africa for 30 years, but lost everything in the riots.
“What made me run is that I saw how they were attacking people, attacking them like dogs. And some of the people who were attacking us were people that have known us for a long time. That’s what hurts me the most,” Setuve said.
Mozambique and Zimbabwe were also considering some sort of repatriation of their nationals.
Al Jazeera’s Fahmida Miller, reporting from the airport in Johannesburg, said a small group was turned back because of “incorrect documentation”.
Ofoegbu said they will have to go to the Nigerian consulate to get the right papers before travelling.
Police on high alert
It was not the first time that foreigners were attacked in South Africa.
“I am so worried about the safety of my family, because these [xenophobic] attacks keep happening, so if I don’t save my family now, I don’t know when [this will] start again,” Ofoegbu said.
“It happened in 2008 and then in 2015, now it is repeating.”
The root cause of the latest violence is still unclear, but high unemployment, poverty, and criminality may have played a role.
Foreigners in South Africa fear for safety after attacks
South African officials were hesitant to describe the violence as xenophobic attacks, and instead said it was an issue of criminality that the government was trying to deal with.
“While there has been a significant decline in the number of incidents, police forces remain on high alert and are closely monitoring hotspots to ensure further violence does not erupt,” Minister of Defence Nosiviwe Mapisa-Nqakula said.
Police have arrested at least 653 people, mostly South Africans but some foreigners as well, in connection to the attacks, Minister of Police Bheki Cele said.
Nigeria’s President Muhammadu Buhari is expected to visit South Africa next month to discuss the violence and seek a solution.