The latest unrest started after the funeral of a 41-year-old Tunisian man who was stabbed to death Monday in an altercation between locals and migrants, which led to the arrests of three suspects from Cameroon.
"We are going to avenge his death!" young people were heard chanting at the victim's funeral in video footage published online.
Hundreds of angry residents massed in the streets of Sfax late Tuesday demanding the eviction of all illegal migrants, said an AFP correspondent. Some blockaded streets and set car tires ablaze.
Videos shared on social media showed police chasing dozens of migrants from their homes to the cheers of city residents, before loading them into police cars.
On the Facebook page of community group Sayeb Trottoir, the medic Lazhar Neji, working in the emergency room of a city hospital, deplored "an inhumane... bloody night that makes you tremble."
Ramadan Ben Omar at the Tunisian Forum for Economic and Social Rights told Reuters that police had sent back hundreds of migrants including women and children this week and left them in a closed military zone along the desert border with Libya.
Ben Omar said rights activists in Sfax had reported beatings of migrants, ejections from accommodation they had rented, and arbitrary detentions by local residents over the past several days before police intervened and restored order.
Tunisia's violence is once more spreading fear and "psychosis" among migrants, said Franck Yotedje, director of the Afrique Intelligence group, in a Facebook comment, urging the Tunisian state to fulfill its duty to "ensure the safety of the residents of Sfax, Tunisians and foreigners."
Last month, hundreds of Sfax residents protested against the presence of thousands of migrants and asked authorities to deport them, saying Sfax must not become a city of refugees.
Thousands of undocumented African migrants have flocked to Sfax in recent months with the goal of setting off for Europe in boats run by human traffickers, amounting to an unprecedented migration crisis for the North African country.
The Sfax branch of the powerful UGTT trade union accused the government of having aggravated illegal immigration "by playing the role of the Mediterranean policeman, intercepting the boats of illegal sub-Saharan African migrants and transporting them to Sfax."
It called on Saied's government to "find a radical solution" to the presence of "thousands of illegal sub-Saharan migrants," and said the Sfax region must not be "transformed into a place of assembly or resettlement for these migrants in a desire to please Italy and Europe."
President Kais Saied said that Tunisia will not be a border guard and that it will not accept the settlement of immigrants in the country.
This report was prepared with information from Reuters and Agence France-Presse.