South Africa has apologised for the deportation last week of 125 Nigerians over suspicions that their yellow fever certificates were fake.
The action quickly turned into a diplomatic spat - with Nigeria refusing South Africans entry and the foreign minister branding Pretoria xenophobic.
South Africa has rejected that claim - and promised new procedures to avoid a repeat of the "regrettable incident".
At one stage Nigerian carrier, Arik Air, suspended flights to South Africa.
Yellow fever is spread through infected mosquitoes and has a wide array of symptoms from nausea and vomiting to kidney failure, jaundice and bleeding.
According to the UN World Health Organization, about half those who develop severe symptoms of the haemorrhagic illness and are untreated die from the disease - about 30,000 people each year worldwide.
"We wish to humbly apologise to them, and we have," South Africa's Deputy Foreign Minister Ibrahim Ibrahim said.
"We are apologising because we deported a number of people who should not have been deported," Mr Ibrahim said - adding that he does not expect an apology from Nigeria for the tit-for-tat deportations of South African nationals.
He blamed airport authorities for what a joint statement with Nigeria described as a "regrettable incident which the South African government believes could have been handled better".
The Nigerians were turned away on 2 March because the yellow fever certificates were not check properly, according to the deputy minister.
South Africa is considering reopening a travel clinic at Johannesburg's airport - so that travellers without a yellow fever certificate can be vaccinated on arrival rather than deported.
And from now on, mass deportations will need the permission of foreign ministry officials, the deputy minister said.
On Tuesday, Olugbenga Ashiru, Nigeria's foreign minister, said the deportations was evidence of xenophobia.
"What you see playing out is what we call xenophobia by South Africans against all Africans - not just Nigerians," AFP news agency reported him as saying.
In 2008, South Africa saw a wave of xenophobic violence which shocked the nation and shook up the world's view of the "rainbow nation".
Mr Ibrahim said on Thursday that South Africa is not a xenophobic country.
The two countries say the yellow fever row will not undermine bilateral relations - and they are moving towards strengthening them.
Nigeria is one of the biggest markets for South Africa's MTN mobile phone operator, while retailer Shoprite and Standard Bank also have profitable operations there.