In the Kismayo meat restaurant at the heart of the Mayfair neighbourhood of Johannesburg, the elders of the city’s Somali community hold urgent meetings about the attacks on foreign-owned businesses and traders that have been surging for more than a week.

On Sunday, two people were reportedly killed and the police had to use teargas and rubber bullets to disperse groups of men armed with machetes and sticks while shouting anti-immigrant slogans.

Officials believe at least 11 people have died and scores of shops have been burned. Many more have been injured and looting has been widespread.

The elders have many questions: when will the next outbreak be? What will the government do? Will their families, homes and businessmen ever be safe?

Amir Sheikh, a community leader who came from Somalia 16 years ago, said: “Every day we are living in fear.”

Play Video 2:38 'No brotherly love’: what's behind the wave of hatred towards foreigners in South Africa? – video

According to community leaders, the attacks last week had been building for several months. Anti-immigrant rhetoric has been circulating on social media and among groups who allege immigrants cheat their customers with out-of-date produce in their shops, take jobs from locals and defraud the state.

Among the victims of the recent attacks were dozens of Bangladeshi shopkeepers including Salahuddin Abdulhilim, who fled political violence in Dhaka nine years ago to start a new life in Soweto, one of Johannesburg’s townships, where he owns a small supermarket.

“I came to work, to earn a living. I pay my taxes, employ seven South African workers, all my papers are in order,” he said.

Abdulhilim, 39, joined hundreds of others who fled to Mayfair in recent days. Many have lost their businesses – burned to the ground, or thoroughly looted. Most had to face terrifying ordeals as they tried to prevent often dozens of men armed with sticks, knives, petrol bombs and sometimes guns from breaking into their shops.

“It was very frightening … We ran. They were coming in with crowbars and hammers … We used to hear of an incident here or there, but now it is all the time. People are dying. It has been getting worse and worse. We are a target and no one wants to protect us,” Abdulhilim said.

Facebook Twitter Pinterest Police patrol the streets after overnight unrest and looting in the Alexandra township in Johannesburg. Photograph: Marius Bosch/Reuters

Violent incidents have been reported in other parts of the country. According to local media, two people were killed and more than 30 arrested near Cape Town when mobs attacked and looted foreign-owned shops on Sunday.

Most migrants in South Africa come from neighbouring countries, especially Zimbabwe, where decades of economic and political instability have forced many of the former British colony’s most talented, motivated and educated overseas.

The exact number of immigrants in South Africa, which has a population of 56 million, is unknown. One senior police official was criticised by experts after he claimed the number was higher than 11 million. A 2011 census had set it at 2.2 million.

The recent attacks have drawn criticism from across the continent. In Nigeria, where South Africa’s diplomatic representations have been closed, South African-owned shops have also been attacked.

Last week, South Africa’s president, Cyril Ramaphosa, made a televised address calling for an end to the attacks, asking citizens to remember the role others on the continent played in the decades-long battle against the repressive, racist apartheid regime.

Facebook Twitter Pinterest People rummage through items from looted foreign-owned shops in Alexandra township. Photograph: Michele Spatari/AFP/Getty Images

But Marc Gbaffou from the African Diaspora Forum, an umbrella group that campaigns for the rights of migrants in South Africa, said there was no political will to stop the violence. “Now the whole world has seen the truth,” he said.

Even though the violence on Sunday was concentrated in the impoverished centre of Johannesburg, there are fears it will spread to neighbourhoods such as Mayfair, in the west, which have long been popular with migrants.

Mayfair residents boast you can hear 30 African languages spoken on its streets and find followers of every faith, while the area has welcomed many new arrivals.

It is also a much-needed “safe haven” in times of trouble, said Sheikh. Nevertheless, in recent days stores, shisha shops and tailoring sweatshops in Mayfair had to bring down their shutters on two occasions, fearing attacks.

The few attempts by groups of thugs to spread the violence into Mayfair were seen off by local men. But the growing anger is directed not just at the attackers but also what is seen as ineffectual policing. “The police are part and parcel of this. They have been harassing migrants for months, using bad language, beating, taking goods,” said Sheikh.

Facebook Twitter Pinterest Nigerian foreign nationals remove a looter from their shops in Troyeville, Johannesburg Photograph: AP

In 2015, seven people were reported killed during outbreaks of xenophobic violence in Johannesburg and Durban. In 2008, more than 60 people died in a more intense outbreak.

Experts cite multiple causes. South Africa has some of the highest levels of violent crime in the world, with soaring unemployment, extreme inequality and patchy policing.

Representatives of migrant communities accuse senior officials in the ruling African National Congress and other politicians of using xenophobic language that encourages attacks.

On Sunday, a statement by the ANC called for an end to the attacks on migrants and but also for tighter border controls, adding that “law-abiding citizens are understandably sick of those who are breaking the moral fibre of our society by turning our kids into prostitutes and drug addicts”.

Loren Landau of the African Centre for Migration and Society at Witwatersrand University said the specific location of xenophobic violence often depended on complex social and political factors on the ground. “This is not just about people who are poor and disappointed … a lot is about local-level politics,” he said.