In Gauteng province, of which Johannesburg is the capital city, police arrested 18 people after overnight street battles, Major-General Phumzo Gela, deputy police commissioner, said on Friday afternoon.
Earlier police fired rubber-coated steel bullets into a crowd of South Africans in Johannesburg's Jeppestown area.
A crowd of South Africans carrying hammers and axes gathered near the city centre, chanting "Foreigners must leave."
Groups of South Africans in Jeppestown and Cleveland blocked roads with rocks and burning tyres and then ordered foreigners to leave the country, police said.
Jeppestown and Cleveland are neighbourhoods adjoining the Johannesburg Central Business District (CBD).