Loveness James was chased from her home in Burnwood, an informal settlement in Durban, in the middle of the night early last week.

"It was a normal day. I went to work at the salon, came home, cooked for my husband and went to bed," the 22-year old Malawian national, who is nine months pregnant, told South Africa's Independent Online.

Then a violent mob broke down the door of her house.

"They started shouting and telling us to leave, they kept chanting that we must leave their country, they hit and kicked my husband. All I could think of was my unborn baby, my water breaking and me giving birth in front of people who wanted us dead," she said.

Other migrants have similar stories after groups started attacking, looting and burning homes, shops and cars owned by foreigners in Durban a week ago. Three people died in the violence, and dozens were injured, like the man in the picture above.

"It was about 1 a.m. on Monday when we were forced out of our rented rooms," Miriam Mussa, a Malawian immigrant, told GroundUp, a South African public interest news agency.

"I was with my baby and my husband. Even though they did not hurt us after seeing that we had a small baby, they allowed us to leave with only the clothes we were wearing. We watched them as they took out all our furniture," Mussa said.

This man was injured in the xenophobic attacks in Durban

Mussa and her family, along with some 60 other migrants, ended up fleeing to a local police station, camping for several days in the open in its grounds. Dozens of others foreigners took refuge in a nearby mosque.

The xenophobic attacks have created a sense of fear and betrayal among the immigrant community, says Hupenyu Makusha, from Refugee Pastoral Care. The Durban-based organization has been providing blankets, tents and clothing to those forced out of their homes.

"These people [the victims] were actually neighbors to the locals, who turned against them. So they feel very betrayed by their neighbors … very insecure," he told DW in a phone interview from Durban.

Ongoing cycle of xenophobic violence

Attacks against foreigners and foreign-run businesses have erupted regularly in the past decades in South Africa.

Against a background of chronic unemployment for black South Africans, immigrants are often seen as stealing valuable jobs and taking advantage of housing and health services squeezed by mismanagement and corruption. Migrants are also often accused of being involved in crime.

The facts simply don't support this, says Loren Landau, the director of the Johannesburg-based Africa Center for Migration and Society.

For example, although exact data is difficult to come by, it's estimated some 1.5 to 2 million migrants live in South Africa, a country with a population of 58 million. But a far larger number – around 9 million – of locals are unemployed.

Read more: Report - Immigrants not threat to jobs in South Africa

"Even if you took [the migrants] out, you wouldn't see that many more jobs," said Landau.

"But it's not facts that are driving the violence. It's the way in which it's being framed by national and local leaders," Landau told DW in a telephone interview.

Parties take a hard line on migration ahead of elections

On May 8, the ruling African National Congress (ANC) is facing what is probably the party's most competitive national elections since the end of apartheid in 1994.

The main opposition party, the Democratic Alliance, already said in September 2018 that immigration would be one of its key campaign issues, arguing that borders needed to be more tightly controlled.

Recently, the ANC has also seized on the issue.

Speaking at an ANC rally earlier in March, President Cyril Ramaphosa promised a crackdown on undocumented migrants.

"Everyone just arrives in our townships and rural areas and sets up businesses without licenses and permits. We are going to bring this to an end. And those who are operating illegally, wherever they come from, must now know," Ramaphosa said before a cheering crowd.

ANC secretary-general Ace Magashule also warned in March about foreigners perpetrating crimes.

"If they are undocumented when crime happens, you can't even get these people. You can't get their fingerprints. [This is about] the safety of the country. It is not being opportunistic," Magashule told City Press, a South African news outlet.

Cyril Ramaphosa and his ANC party are facing tough general elections

Migrants 'scapegoats' for government failures

These kinds of statements imply that immigration and lapsed border control are somehow responsible for South Africa's considerable social problems rather than the government's failure to tackle crime, lack of services, poverty and corruption, says Landau.

The ANC has "started to look for scapegoats, look for excuses – and migrants are a convenient excuse," he said.

The strongest words against the xenophobic attacks in Durban came from Julius Malema, the leader of the Economic Freedom Fighters (EFF), while addressing a party rally on Saturday.

"We don't want votes from people who are xenophobic," he said. "We must love one another as Africans because showing love to someone from Mozambique, Guinea, Egypt and Nigeria is self-love."

At the same time, Malema regularly makes inflammatory comments about 'Boers' (white Afrikaans-speaking farmers), Jews and southeast Asians and is often accused of inciting racial divisions in South Africa.

President Cyril Ramaphosa said he "condemned violence against foreign nationals in South Africa" in a statement issued by his office on Monday – more than a week after the first attacks broke out.

Ramaphosa also called on police to identify those responsible and bring them to justice.

When it comes to persecuting xenophobic crimes, however, the state has a poor track record.

According to Human Rights Watch, "virtually no one has been convicted for past outbreaks of xenophobic violence, including the Durban violence of April 2015 that displaced thousands of foreign nationals."

Hundreds of foreign nationals attended a meeting organized by the local government after the attacks

'Hesitant' condemnation of attacks

In Durban, more than 70 Malawians caught up in last week's xenophobic attacks are looking to return to their country, according to Hupenyu Makusha, because they are too scared to stay.

As for the political response to the violence, while Makusha praised the local government for working "tirelessly" to calm the situation, he said it's been "too hesitant" at national level.

"To me, this seems to signal a point where, if the leadership, especially the president and members of the ruling party, are not saying anything … then it is maybe interpreted in different ways.

"One may say that it means approval," he said.