A 30-year-old man from Benin died after seven Tunisians set upon a group of 19 migrants in a house in El Haffara, a working-class area of Sfax, Tunisia's second city, local court spokesman Faouzi Masmoudi said.
Videos of the Sfax attack show seven men involved in the assault on the migrants, Masmoudi said, adding that the three suspects arrested as part of a judicial investigation were aged 17, 23 and 36.
Five others were hospitalized in the May 22 attack but "not seriously wounded," he said, adding that the motivation behind the violence was being investigated.
A coalition of 23 rights groups said in a statement that the stabbing death followed a series of "speeches of incitement to hatred and racism against migrants from sub-Saharan Africa."
"Hate speech and intimidation" targeting migrants is fueling "violent behavior against them," charged the Tunisian Forum for Economic and Social Rights.
Tunisian authorities are creating a "climate of impunity and normalization of violence", argued the group, which includes the Tunisian League for Human Rights and the World Organization Against Torture.
Tunisia has seen a rise in racially motivated attacks on migrants and foreign students following comments by President Kais Saied in February in which he blamed sub-Saharan Africans for a "wave of violence and crime" in the country.
The North African country of 12 million people hosts an estimated 21,000 migrants from other parts of Africa, representing 0.2 percent of the population.
Following Saied's February speech, many sub-Saharan Africans in Tunisia lost their jobs and homes overnight, and multiple assaults were recorded.
While some migrants come to Tunisia to study, many use the country as a springboard for attempts to reach Europe by sea, usually to the Italian island of Lampedusa which is 150 kilometers away.
European governments have pressured Tunisia to prevent the dangerous sea crossings.