Two West African states are repatriating their citizens from Tunisia following inflammatory remarks by President Kais Saied last week.
Mr Saied said that illegal migration was causing demographic change in Tunisia, and accused “illegal hordes” of being behind rising crime.
Dozens of migrants from sub-Saharan Africa have since been detained.
Ivory Coast and Guinea said they were sending specially charted planes to bring back their nationals.
“The most urgent thing is to save lives, to prevent injuries,” Ivory Coast’s government spokesman Amadou Coulibaly was quoted as saying by AFP news agency.
Tunisia had an estimated 21,000 migrants from sub-Saharan Africa in 2021, according to official figures quoted by a local rights activist who accused Mr Saied of “inciting hatred” and “racial discrimination against African migrants”.
Mr Saied has denied being racist.
After his comments, many migrants lost their jobs and housing overnight. Some have reported being physically assaulted.
Hundreds of Ivorians and Guineans have since registered with their countries’ embassies to be repatriated.
“The undeclared goal of the successive waves of illegal immigration is to consider Tunisia a purely African country that has no affiliation to the Arab and Islamic nations,” Mr Saied said.
The African Union – of which Tunisia is a member – condemned the statement as “shocking”, and warned against “racialised hate speech”.
About 80% of Tunisians believe that racial discrimination is a problem in their country – the highest figure in the Middle East and North Africa region, according to a survey published by BBC News Arabic last year.