Police and government officials say organized criminals are also taking advantage of the anti-foreigner sentiment by using it as a cover for looting and shooting sprees. President Thabo Mbeki said Sunday that he would set up a panel of experts to investigate. African National Congress President Jacob Zuma, who is likely to succeed Mbeki next year, condemned the attacks.
"We cannot allow South Africa to be famous for xenophobia," he told a conference in Pretoria. The government is trying in vain to change South Africa's image from the crime capital of the world - it has a murder rate of more than 50 per day - before the 2010 soccer World Cup. Police said the worst violence erupted after midnight Saturday in a rundown inner city area called Cleveland that is home to many immigrants. Two of the victims were burned and three others beaten to death. More than 50 were taken to hospitals with gunshot and stab wounds.
"It's spreading like a wildfire and the police and the army can't control it," said Emmerson Zifo, a Zimbabwean teacher.
Johannesburg is South Africa's economic hub and home to hundreds of thousands of immigrants. Many of them are illegal, but many have also been here for more than a decade and possess South African identity documents.
There has been sporadic anti-foreigner violence for months, mainly aimed at stores run by Somalis accused of undercutting local storeowners, but nothing to compare with the current scale.
In another inner city suburb, Hillbrow, on Sunday an Associated Press photographer saw the body of a man who had been shot dead.
Another person was shot dead and two more wounded in similar attacks on Saturday in Tembisa in another part of greater Johannesburg after residents went on a rampage, destroying property that belonged to foreign nationals.
Imtiaz Sooliman of the Gift of the Givers, which has been handing out blankets and food to affected people all week, said his organization was called in to help at a police station in Germiston, outside Johannesburg.
He said violence raged for four hours overnight and by the end 2,000 people were waiting for help.
"My staff said it was like a war zone. There was lots of police and stones being thrown. They said it looked like the police couldn't cope," he said.
Eric Goemaere, the head of Medecins Sans Frontieres in South Africa, said his staff was helping to treat people with bullet wounds and back injuries from being thrown out of windows. The humanitarian group is also known as Doctors Without Borders.
He said Johannesburg's Central Methodist Church, home to hundreds of Zimbabweans, was under siege overnight and that police had told people they should be prepared to defend themselves.
"It's a crisis," he said. He called on the South African government to declare Zimbabweans - there are believed to be up to 3 million in South Africa - as refugees and give them proper protection.
Edgar Gweru, from Zimbabwe, said he was robbed of cash, his passport and DVD player. He managed to escape by climbing onto his roof and hiding there until 2 a.m., but he does not know what happened to the three people sharing his accommodation.
He said the gangs were combing the Cleveland surburb street by street, apartment by apartment.
The the stench of tear gas hung over Cleveland's main street, which was littered with garbage and glass. There were two burned-out cars and many shops had been burned and looted. Police maneuvered an armored vehicle in front of a liquor store.
A crowd of dozens of stick-wielding people, many visibly drunk, sang and danced. One held a crude sign saying "hamba kwerekwere," or "foreigners, get out." One poster said "they (foreigners) steal our jobs and everything that belongs to us."
Michael Khondwane said foreigners were to blame for South Africa's drug and crime scourge.
He said the ransacking of stores run by foreigners would send them "the message that they must go."
About 500 people sought refuge at Cleveland police station - a pattern repeated throughout the city. Red Cross volunteers scrambled to provide them with blankets and food.
Zifo said the vast majority were, like him, Zimbabwean. He said he fled Zimbabwe at the start of this year because he felt he would be victimized for taking part in a teachers' strike last year.
"Even now, I would rather be in Zimbabwe," he said.