A South African envoy expressed the country's "sincerest apologies" to Nigeria on Monday, after a wave of anti-migrant attacks swept through Johannesburg and surrounding cities in recent weeks, fuelling diplomatic tensions.
A meeting with Nigerian President Muhammadu Buhari in the capital Abuja was held to convey President Cyrial Ramaphosa's "sincere apologies about the incident that has recently transpired in South Africa," the special envoy, Jeff Radebe, told reporters.
"The incident does not represent what we stand for," he said, adding that South African police would "leave no stone unturned, that those involved must be brought to book."
In a statement after the meeting Nigeria's presidency said "President Buhari responded to profuse apologies from the South African president, pledging that relationship between the two countries will be solidified."
Johannesburg and surrounding areas were rocked by a series of deadly attacks on foreigners in recent weeks, with many directed against Nigerian-owned businesses and properties.
At least 12 people were killed in the violence that left hundreds of shops destroyed.
No Nigerians were killed according to South African authorities but the violence led to condemnation across Africa, particularly in Nigeria, fuelling diplomatic tensions between the continent's two leading nations.
The violence also prompted reprisal attacks against South African firms in Nigeria and the temporary closing of South Africa's diplomatic missions in Lagos and Abuja.
Last week, almost 200 Nigerian migrants were repatriated back to Lagos, Nigeria's commerical capital, following the unrest.
At least 400 more are expected to return out of some 100 000 Nigerians estimated by the government to reside in South Africa.
Buhari and Ramaphosa are expected to meet at a state visit in South Africa next month.