South Africa’s government has pledged to protect foreigners threatened by a recent outbreak of violence that has forced 13,000 to flee their homes.
Officials also said the country would not deport migrants without documents during the current period.
The attacks began a week ago north of Johannesburg, before spreading to the city and surrounding areas.
At least 23 people have been killed, and ministers have been discussing using troops to quell the violence.
On Tuesday police fired rubber bullets to disperse a crowd in one suburb during a crackdown on the violence.
Police said they had made another 40 arrests overnight, in addition to 250 in recent days.
During a visit to a refuge for migrants in east Johannesburg, Minister for Safety and Security Charles Nqakula promised protection and temporary accommodation to foreigners.
He said there would be tough law enforcement and no more foreigners should be harassed.
His wife, Home Affairs Minister Nosiviwe Mapisa-Nqakula, said the government could not “be seen to be opportunistic”.
“We cannot take advantage of people who are finding themselves in a state of vulnerability,” he said.
“We have an obligation at this point in time to ensure that their lives are protected.”
The attacks on foreigners began a week ago in the township of Alexandra, north of Johannesburg, before spreading to the city centre and across the Gauteng region.
Mobs have been roaming townships looking for foreigners, many of whom have sought refuge in police stations, churches and community halls.
In the latest attacks, two people, believed to be miners from Mozambique, were reportedly beaten to death.
Local official Zweli Dlamini said that the attacks had occurred in four new areas in the Ekurhuleni region around Johannesburg.
There have also been reports of attacks on South Africans from other parts of the country.
Some South Africans say foreigners are taking jobs from locals and contributing to crime.
There are believed to be between three and five million foreigners living in South Africa, most of them Zimbabweans fleeing poverty and violence at home.
One Ugandan living in Johannesburg said he had seen a crowd setting a man on fire.
“The police managed to get to him and sprayed him with a fire extinguisher to put the fire out,” he said
“I am not sure what happened to him. It was terrifying.”
Bishop Paul Veryn of the Central Methodist Church, where many foreigners have sought shelter and which was attacked over the weekend, said the attacks were “clearly orchestrated”.
He told the BBC’s Network Africa programme that the mobs appeared to have been passed information on where foreigners lived.
President Thabo Mbeki has urged South Africans to welcome foreigners.
He has said that extra police sent to the affected areas would get “to the root of the anarchy”.
Officials have not ruled out deploying troops, as demanded by human rights groups and the opposition.
Gwede Mantashe, Secretary General of the ruling African National Congress (ANC), said that if the army was deployed, it would be to back up the police.