Two West African states are repatriating their citizens from Tunisia following inflammatory remarks by President Kais Saied last week.
Mr Saied said that migration was a “plot” to change the country’s demographic profile, blaming “traitors who are working for foreign countries”.
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.
“These words gave so many people who already had these racist feelings a green light,” a student from southern Africa told the BBC’s Africa Daily podcast.
She said many sub-Saharan Africans were scared to go outside after others had their “houses set on fire, some beaten up, some harassed, some verbally insulted”.
“We don’t feel very safe to go to the authorities because we feel like some of them are also in on this… Some of my Tunisian friends say they feel ashamed to be Tunisian at this point because of what is happening.”
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”.
Tunisia tennis star Ons Jabeur on Wednesday posted a tweet condemning “discrimination” and calling for “the right of everyone to live with dignity”.
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.