South Africa deployed the army on Tuesday in "volatile areas" to curb a wave of anti-immigrant violence that has killed at least seven people this month, the defence minister said.
The latest wave of anti-immigrant attacks began almost three weeks ago in parts of the coastal city of Durban in Kwa-Zulu Natal and quickly spread to Johannesburg, South Africa's commercial capital.
Defence Minister Nosiviwe Mapisa-Nqakula said soldiers were being sent to "volatile areas", which included the rundown Johannesburg district of Alexandra and parts of Kwa-Zulu Natal.
"There will be those who will be critical of this decision but the vulnerable will appreciate it," Mapisa-Nqakula told reporters in Alexandra.
South Africa has been criticised by foreign governments, including China, Nigeria and Zimbabwe, for failing to protect foreigners as TV stations broadcast images around the world of armed mobs looting immigrant-owned shops.
President Jacob Zuma's government was put under further pressure when disturbing images appeared in local media on Sunday of men beating and stabbing Mozambican man Emmanuel Sithole to death in broad daylight.
Mapisa-Nqakula said a Zimbabwean couple was also shot at in the Alexandra on Monday night but they survived.
In 2008, more than 60 foreigners were killed in similar unrest as locals vented frustrations over various issues, particularly a lack of jobs in the continent's most advanced economy.