SOWETO, South Africa— Hukun Geelle Hassan built his convenience store on faith in this country’s promise to protect foreigners who came to do business here. In an hour, his neighbors destroyed all that.
His Walala Wasala Shop was among hundreds of foreign-owned businesses that have been looted since another Somali shopkeeper shot and killed a young man in January who police said tried to rob him.
On Friday, police said a foreign merchant in Soweto was seriously injured overnight when South African rivals firebombed his shop. A dozen more shops were looted in late February in Cape Town.
At Mr. Hassan’s Soweto shop in January, customers he served for years ripped shelves off the blue concrete walls. A police officer who answered Mr. Hassan’s call for help carried away a roll of toilet paper, video he shot with his cellphone shows. “They took everything,” Mr. Hassan said.
Former President Nelson Mandela overcame white-minority rule by convincing South Africans they were better off united than divided. In the euphoria of the first free elections in 1994, Archbishop Desmond Tutu called the country the “Rainbow Nation.”
But as South Africa’s economy falters, it is no longer so welcoming to outsiders. Merchants from poor countries stretching from Ethiopia to Bangladesh, as well as rich foreigners that are buying up wine farms, game parks and farmland, have been drawing the ire of the ruling African National Congress and its supporters.
The government has also restricted the kinds of work open to foreigners to promote local hiring. Officials want foreign security firms to sell more than half of their shares to South Africans. New gas- and oil-prospecting plans may mandate a 20% share for the government to guarantee some local gains.
On Feb. 12, President Jacob Zuma said he would bar foreigners from owning farmland, a riposte aimed at opposition politicians who have called his ANC “the bodyguard of white capital monopoly.”
Economists say policies designed to appease the ANC’s poor political base risk alienating investors amid deep uncertainty in the global economy. In February, South Africa’s rand currency hit a 13-year low against the U.S. dollar.
“It’s a very unstrategic and increasingly populist approach,” said Ingrid Palmary, director of the African Center for Migration & Society at Johannesburg’s University of the Witwatersrand.
South Africa’s economy has been growing less than 2% a year. In 2014, foreign investors sold more than $780 million of South African bonds. More than half of people here younger than 25 are unemployed.
Gwede Mantashe, the ANC’s powerful secretary-general, made no apologies for the party’s embrace of policies that appeal to struggling South Africans. “Sometimes, people talk to us as if we are governing for foreign investors. They are not citizens. The interests of citizens come before foreigners.”
The shift is alarming South Africans who celebrated their country’s diversity. Those who blame foreigners for their grievances, Archbishop Tutu said on Feb. 15, are “spitting in the face of nonracialism and undermining a key foundation stone of our democracy.”
For nearly a decade, xenophobic attacks have flared sporadically across the country. Hundreds of stores have been ransacked every year since a wave of violence that killed more than 60 foreigners in 2008, according to Human Rights Watch and immigrants’ rights groups.
Amnesty International said in February that not one South African has been convicted of a crime related to any of those thefts, assaults and murders. The country’s National Prosecuting Authority confirmed that is the case.
Mr. Mandela encouraged a spirit of pan-Africanism to bolster the continent on the world stage. A refugee act he signed in 1998 opened the door to more than 300,000 asylum seekers fleeing persecution in Ethiopia, Somalia, Zimbabwe and other African countries.
Today, many poorer South Africans feel such openness has compromised their future.
Owen Dooka said competition from foreigners drove one of his two Soweto convenience stores out of business. He withdrew his children from a fee-based school and sold two cars to make ends meet. He joined a group urging foreigners to close their shops to improve the prospects of South African-owned businesses. “Really, the government has failed us. It’s a ticking bomb.”
He wants the government to investigate whether foreigners are driving them out of business with improper tactics such as flooding a neighborhood with stores and dodging taxes. South Africa’s small-business minister, Lindiwe Zulu, said that inquiry is under way.
Amir Sheikh, head of the Somali Community Board of South Africa, said there is no secret to his countrymen’s strategy: They work hard. Foreign merchants often stay open longer and sell more goods at thinner profit margins than South African competitors, research has shown.
“If they can’t cope with the competition, they shouldn’t be in business,” said Mr. Sheikh, who co-owns three small shops spread across the poor fringes of Johannesburg.
He said Mr. Dooka’s group is threatening Somali business owners in Soweto. “It’s intimidation, showing their muscle.”
After the Somali shopkeeper shot and killed the teenage boy who tried to rob him in January, South Africans ransacked dozens of foreign-owned shops in Soweto and other poor districts. A half-dozen people were killed. More than 100 were arrested.
Many foreign merchants retreated to Somali and Ethiopian enclaves near downtown Johannesburg. Some people in Soweto were cut off from the staples they buy at corner shops, fueling regret over the riots that drove merchants away.
“People had no reason to attack anyone,” said Ignatius Vena, a 28-year-old rapper who buys snacks from Mr. Hassan’s shop, closed since it was ransacked.
Mr. Hassan is no stranger to violence. He left Somalia in 2009 after Islamist militants killed his father and brothers in a rocket attack. He rode buses to Johannesburg from Mogadishu, a 3,000-mile journey that took one month.
After a year working in other shops, he saved up $3,000 to build his own spare concrete store in Soweto’s poor Snake Park neighborhood. Before long, Mr. Hassan was earning as much as $3,500 each month. He married twice and had four children—two with each wife.
On Jan. 21, two days after another Somali merchant shot the young robber near his Walala Wasala shop, Mr. Hassan awoke to find a crowd out front. He recognized many of his regular customers.
The crowd surged through the store’s rolling metal gate. Someone fired a pistol at the concrete doorway. “You foreigners voetsek!” one person shouted, using South African slang for “get lost.”
One recent afternoon, Mr. Hassan was back at Walala Wasala, asking his landlord for permission to build a brick wall and sturdier metal gate around the storefront.
The landlord’s brother was sympathetic. “Their success is their own. We should emulate it,” said the brother, retired driver Isaac Galele.
Mr. Galele’s brother Thomas, who leases a portion of his front yard to Mr. Hassan’s store, was less understanding. “My neighbors do not want me to rent out to foreign shop owners. This fighting is never going to end.”
But Mr. Hassan was determined to stay and salvage his business.
“If I had a choice I wouldn’t go back to Soweto,” he said. “But I don’t have anything else.”