The immigrants fled the township of Soweto following the xenophobic attacks that killed three people on Wednesday.
Violence erupted after residents accused a Somali businessman of shooting a teenager and his friend who allegedly tried to enter his shop.
The police believe that this incident is at the root of the deadly clashes and scenes of violence that have spread to other areas of Soweto.
Residents also accused shop owners of selling stale foods.
A total of 27 people were arrested, according to a police statement.
The police condemn the attitude of all those people who preferred to do justice instead of letting the police act.
According to South Africa’s TimesLive news website, unrest continued late Wednesday night.
A xenophobic message was then circulated through the WhatsApp app inviting anyone who rented a room or house to a Somali to expel him.
According to this message, anyone who does not comply with this injunction before September 8th will see their homes and shops burned down.
A number of these foreign-owned shops are built in the yards of the residents.
They are managed by Ethiopians, Zimbabweans and Pakistanis.
Many traders have temporarily closed their stalls and are leaving Soweto for fear of further violence.