Johannesburg - High unemployment and a failure to address growing inequality are to blame for a wave of anti-immigrant attacks in South Africa, say analysts.
"We believe that the cause of the xenophobic attacks is policy failure by the government," said Mienke Mary Steytler, of the South African Institute of Race Relations.
"High unemployment and inequality are not being tackled."
The violence has left at least six dead and more than a thousand displaced since the beginning of the month, with attacks spreading from Durban to parts of Johannesburg.
"The root of this problem lies in our inability to bring about economic growth and decrease the inequality that plagues our nation," said DA parliamentary leader Mmusi Maimane.
"It is the hopelessness that results from unemployment that drives drug use and criminality in these communities, and underlies xenophobic attacks."
In January, foreign shopkeepers in and around Soweto were forced to flee and six were killed as looters rampaged through the area.
And in 2008, 62 people were killed in xenophobic violence across the Johannesburg's townships.
‘People are frustrated’
The current outbreak has been largely blamed on a speech last month by King Goodwill Zwelethini, in which he reportedly blamed foreigners for South Africa's high crime rate and said they should "take their bags and go" - to loud applause.
The king has since said his words were misinterpreted, but for some, Zwelithini simply articulated what many were feeling.
"People are frustrated," said Braam Hanekom, director of Passop (People against Suffering, Oppression and Poverty), a Cape Town non-profit organisation that supports asylum seekers, refugees and immigrants.
"It's hard to fight for jobs. It's hard to fix the economy. It's hard to create opportunities. It's very easy to blame someone, but it's hard to blame the elected leadership who have the majority of support on the ground.
"It's much easier to find a soft target to express your frustrations, whatever those frustrations are, and foreign nationals are the soft target that frustrated communities have chosen to pick on."
Foreigners make up only 1% of the working population in KwaZulu-Natal and only 4% nationally, according to a study released last year by the Wits University-based Migrating for Work Research Consortium.
The researchers also found that foreign workers were more likely to take jobs South Africans were not willing to do, or to start their own business: 21% were self-employed and 11% were employers.
'I want foreigners to be protected'
In downtown Johannesburg earlier this week, as foreign traders closed shop and clustered anxiously on the sidewalk, South African Eveline Mangani elbowed her way in front of a camera and began loudly decrying the anti-immigrant sentiments.
"I'm very hurt by people saying they must be kicked out of the country, because I survive thanks to them," she said.
"I get all my stock to resell from them. So I can put food on the table, so that my five kids can survive. Now the shops are closed and look at my bag: it's empty. I want the shops to open and I want them to be protected - Somalis, Ghanaians, Ethiopians must be protected."
The commercial success of foreigners running small general stores can be a sore point and a cause for envy, said Paul Ngema, provincial general secretary of the National African Chamber of Commerce and Industry (NAFCOC).
"When you look at people, they derive their income from running 'spaza' shops. Most of these foreigners, they come and also run the same small businesses - and they happen to do it better than the local ones. You may call it perhaps jealousy."
In January, Small Business Development Minister Lindiwe Zulu was accused of fuelling anti-immigrant sentiment when she said foreign shopkeepers should share their trade secrets.
"Foreigners need to understand that they are here as a courtesy and our priority is to the people of this country first and foremost," she was reported as saying at the time. "They cannot barricade themselves in and not share their practices with local business owners."
But as the violence has continued the message from government has changed.
"Many [foreigners] are in the country legally and contribute to the economy and social development of the country. Many bring skills that are scarce that help us to develop the economy and are most welcome to live our country," President Jacob Zuma said in parliament on Thursday.