Foreigners displaced by xenophobic violence would be better housed in small, localized shelters rather than large refugee camps, government officials said Thursday.

Camps sheltering thousands of refugees could raise security and health issues, government spokesman Themba Maseko said after a Cabinet meeting where ministers discussed the crisis.

"We should not opt for the creation of refugee camps but create temporary shelters because every attempt must be made to reintegrate foreign nationals," he said.

About 40,000 foreigners — many from Mozambique, Zimbabwe and Malawi — have fled their homes since attacks on immigrants erupted in a Johannesburg township nearly three weeks ago and then spread to other parts of the country. At least 56 people were killed by South Africans who blame foreigners for crime and accuse them of taking jobs.

Click here for photos.

The government is under pressure to move those who have sought refuge in police stations, town halls and churches to better shelters amid concerns about deteriorating conditions and the risk of disease.

In Cape Town, nearly 20,000 people are staying in makeshift tent cities, but authorities have been criticized for promoting "internment camps" in remote locations.

Maseko said many of the displaced have jobs and school-age children. He said the government does want to uproot them further by putting them in large camps far away from their communities.

He said the displaced would be housed in temporary shelters for up to a month, cautioning against keeping people there longer. Rather than putting government resources into shelters, greater effort should be put into local communities, he said.

Troops remain on standby should the violence flare up again, he said.

President Thabo Mbeki last week gave the army the go ahead to step in for the first time since the end of apartheid in 1994.