South African youths recently swept through an intersection in the heart of Soweto township, breaking into immigrant-owned shops and grabbing whatever they could — soda, a loaf of bread, sometimes even the shelves. Nearly 40 years ago, at the same intersection, young blacks marched to protest the white racist rulers of the time, drawing a bloody crackdown that shocked the world.

The recent looting and unrest that hit Soweto and other areas around Johannesburg was not as bloody as the anti-apartheid demonstrations and the ensuing bloodshed in 1976. But it alarmed a nation built on the ideals of racial reconciliation and underscored that, two decades after apartheid was replaced by the promise of a "rainbow nation," many South Africans remain marginalized by a lack of economic opportunity.

Resentment against foreigners stoked the looting and rioting in late January that killed six people and forced many shopkeepers to flee.

Joyce Piliso-Seroke, 81, was arrested in 1976 for trying to help the marching students, some of whom burned buildings linked to the apartheid state. The anti-government movements that once aired frustrations against white minority rule now control the state but don't have answers for the younger generation, she said.

"It's complete silence now in the country," Piliso-Seroke said, referring to the lack of effective prescriptions for fixing education and providing employment.

The weeklong disorder was sparked by the shooting of a 14-year-old South African boy by a Somali shop owner who believed he was being robbed. The rioting has died down and minibus taxis daily clog the road at the Soweto intersection. On the sidewalk, overturned crates and a discarded door form a stand where bruised bananas and leafy spinach, pieces of bright cloth and plastic buckets are sold. A decades-old dilapidated shopfront faces a recently built supermarket chain.

Rows of high-heel shoes and strappy sandals are laid on a faded floral bedsheet on the pavement at a shoe stall run by Morena Malefetse, 29, and Tshepo Tsosane, 27. It could have been an easy target for looters but they ignored the merchandise of local vendors, instead targeting a foreign-owned butchery and an electronics shop.

Malefetse and Tsosane condemned the violence against shops owned by people from Somalia, Ethiopia, Pakistan, Bangladesh and elsewhere. But they said they understand the frustration on the streets.

"Young South Africans are hungry," said Malefetse, who sports tattoos on his calf and forearm.

"It makes them angry, seeing foreigners come into the country like it's a land of milk and honey, finding opportunities," said Tsosane, who supports a young son.

Malefetse and Tsosane have diplomas in computer science but have been unable to find work in their fields and so have worked as security guards, installed satellite dishes and baked and sold cakes. They have been running their shoe stall for about a month.

Peering over his sunglasses, Malefetse said he doesn't understand how immigrants from war-torn, impoverished African nations can set up and successfully run businesses in South Africa.

In another part of Johannesburg, known as Little Mogadishu, Somali Salat Abdullahi recalled how relatives raised funds to buy him a bus ticket to South Africa. In 2013, while he was away at boarding school, an attack by Islamist extremists killed his family.

"People said, go to South Africa, your life will be settled there," said the 20-year-old, slumped in a dirty office chair outside the makeshift office set up to help displaced shop owners by the Somali Community Board of South Africa.

This month, though, he ended up barricaded in his Soweto shop while looters threatened him. Police escorted him out of the area.

Tall and with angular features, Abdullahi stands out in South Africa and he said customers had sometimes insulted him.

"What they are doing is racist," he said.

African immigrants in South Africa remain cautious after a spate of anti-foreigner attacks in 2008 left 60 people dead. There are also concerns about the official attitude toward immigrants.

Lindiwe Zulu, the minister for small business development, was an anti-apartheid activist who spent time as an exile in Tanzania, Uganda and Angola, and previously served as a special adviser to President Jacob Zuma on international relations.

"Foreigners need to understand that they are here as a courtesy and our priority is to the people of this country," said Zulu, after the looting. "They cannot barricade themselves in and not share their practices with local business owners."