President Kais Saied on Tuesday ordered security forces to halt all illegal immigration into Tunisia and said any undocumented migrants must leave, comments that prompted some strong criticism.
Speaking to Interior Minister Tawfiq Charfeddine in a video posted online, Saied said his opponents had twisted his comments in order to spread discord.
Rights groups have accused Saied of racism, called his statement on Tuesday fascist and announced plans to protest.
Saied said legal African residents should feel reassured and that he would not allow anybody to harm them.
A Nigerian students association in Tunisia wrote to its members advising them not to spend time in certain districts of the capital Tunis or to be outside without documents.
Reuters spoke to one man from Mali and another from Ivory Coast who are living in Tunisia without official documents and who said they were staying in their homes for fear of arrest or abuse.
Tunisia is a major departure point for migrants seeking to cross the Mediterranean and over the past year there has been a big increase in the number of Tunisians and other Africans trying to reach Europe.