JOHANNESBURG, South Africa (CNN) -- The atmosphere was tense in Cape Town on Friday after xenophobic violence that has left more than 40 dead in Johannesburg spread to South Africa's largest city.



Immigrants from Mozambique line up in Primrose, South Africa, to board buses back home.



Clashes overnight resulted in one death and 15 arrests and the evacuations of 420 foreign nationals, a police official in Cape Town said.



"Crowds of people went on a rampage, looting and carrying out acts of violence," said Cape Town Police Superintendent Billy Jones. They were charged with public violence and are to appear in court Monday.



One foreign national, a Somali, died when he was run over by a vehicle as he tried to escape the angry crowds, Jones said. Twelve people suffered minor injuries.



He said Friday was tense but calm, with state and local police stationed throughout the area.



Jack Bloom of the opposition party Democratic Alliance told CNN on Friday that government troops were helping police ward off violence in Johannesburg.



Aid workers and volunteers were providing tents, food and supplies at the police stations. Bloom estimated that about 2,000 foreigners had sought haven at those locations.



It was the first violence in the coastal city since a wave of xenophobia began about two weeks ago in Johannesburg, resulting in at least 42 deaths.



The foreign nationals were transported from the city after angry crowds formed at a public meeting seeking to calm tensions, Jones told CNN. They were being housed at community centers and churches.



The attacks in South Africa have forced thousands of immigrants to flee, prompting neighboring Mozambique to declare a state of emergency on Friday. Desperate stories of those fleeing violence



The country's Foreign Minister Oldemiro Baloi said the decision was taken after about 10,000 Mozambicans fled from South Africa.



CNN's Robyn Curnow reported long lines of people -- including many from Zimbabwe and Mozambique -- waiting for buses in Johannesburg to take them home.



Bloom, from Gauteng province, which includes Johannesburg, said the attacks on foreigners who fled to South Africa for a better life has become a "humanitarian crisis."



South African President Thabo Mbeki has approved the deployment of the army to help stop the attacks, which have drawn condemnation from South African officials and other African leaders.



About 28,000 people have been displaced by the violence, Hangwani Malaudzi, a spokesman for the Ministry of Safety and Security said. And more than 400 have been arrested for crimes ranging from murder, to causing a public disturbance, he said.



The country has also seen a disturbing throwback to the 1980s apartheid-era lynching tactic of "necklacing," which was widely used in the townships at the time.



Used on suspected informants, the "necklace" is a car tire, filled with petrol, put around the person's neck and set alight.



The victims are mainly immigrants and refugees from other parts of Africa, including Zimbabwe, where a devastated economy has sent at least two million people across the border in search of a better life.



Some say the attacks stem from a long-standing feeling among locals that the number of immigrants in South Africa results in shortages of jobs and essential needs.



Inadequate housing, a lack of running water and electricity, the rising prices of food, and escalating crime -- nearly 20,000 people were slain in South Africa last year -- add to the resentment.  Watch analysis of reasons behind xenophobic attacks »



According to South Africa's latest census, the country has about 45 million people. The South African Department of Human Affairs estimates that more than 4 million people reside in South Africa illegally, but that figure is based on a 10-year-old study and some feel the number of immigrants in South Africa is much higher.



Some say that millions have recently fled to South Africa from Zimbabwe because of violence there since the county's stalled election.



A presidential run-off between long-time leader President Robert Mugabe and his opposition challenger, Morgan Tsvangirai, is scheduled for June 27 in Zimbabwe -- three months after the initial vote.



Zimbabwe also is in the midst of
what did the police do when did this take place?
ward off violence in Johannesburg. Friday
question: what did the police do, answer: ward off violence in Johannesburg. | question: when did this take place?, answer: Friday