South Africa has resolved a trade row with the US which threatened millions of dollars worth of business, its trade minister has said.
The US had said it would throw South Africa out of its preferential trade programme over its refusal to allow the importation of American chickens.
President Obama had set the end of 2015 as the deadline to resolve the dispute.
Last-minute negotiations which dealt with South African health concerns ended the row.
For more than a decade, South Africa – like several other African countries – has enjoyed preferential trading status with the US under the African Growth and Opportunity Act (Agoa).
The BBC’s Karen Allen in Johannesburg said this was worth more than $170m (£117m) a year to South African farmers exporting citrus fruits, wine and nuts.
South Africa’s Trade Minister Rob Davies said, when announcing that a deal had been struck, that 32,000 jobs depended on Agoa.
The US had been upset that South Africa was imposing what it saw as unfair restrictions on the import of American chickens over worries about avian flu and salmonella.
But Mr Davies said he had received assurances from the US authorities over the safety of their meat exports and added that rigorous safety checks would now be carried out.