When Wal-Mart Stores, the world’s top retailer, bought control of major South African discount chain Massmart Holdings in 2011, American shopping mall developer Irwin Barkan had an epiphany.

An industry veteran of 30 years, Barkan’s US home market was “greying”, while the youthful, underdeveloped African continent offered a sweet spot, with a rapidly expanding middle class and no competition from online retailers.

“When Wal-Mart announced it was buying 51% of Massmart, I knew that if I was going to stay in business, Africa was where I had to go,” he said.

He moved last year to Ghana, one of the continent’s brightest economic hopes, and his company, BG International (BGI), has broken ground on what will be an 18,400-square-metre (200,000 sq ft) enclosed mall in West Accra. Another mall planned for Ghana’s second city of Kumasi is at a similar stage.

Barkan is not alone. Across Africa, commercial real estate developers are responding to the lure of one of the world’s fastest-growing consumer markets and rushing to build malls for eager retailers.

Consumer spending accounted for more than 60% of sub-Saharan Africa’s buoyant economic growth, the World Bank said in its Africa Pulse report in April, adding economic growth would accelerate to more than 5% over the next three years, far outpacing the global average.

But for developers, it’s still a risky business. Investors estimate it costs between $35mn and $60mn to build a mall in Africa, which limits the number of players.

Other obstacles include the difficulty of acquiring secure land titles — few African countries have unified land registries — and a lack of reliable data on consumption patterns, which means developers are sometimes reduced to guesswork when it comes to choosing where to site a new mall.

In Sub-Saharan Africa, typical development returns are between 12 and 16%, while rental yields for the best existing malls are about 7%, a small premium over the 5% for the best European sites, said Peter Welborn, managing director of Africa at real estate consultant Knight Frank.

The yield, which is the rental income expressed as a percentage of the real estate’s value, is kept low by strong local investment demand and makes many foreign investors think the return is not worth the risk, Welborn added.

Sub-Saharan Africa’s middle class is still small by global standards, but investors are betting on steep growth.

Consulting firm McKinsey estimates that by 2020 Africa’s spending power will be $1.4tn, up from $860bn in 2008, and there will be 65 cities with a population of over 1mn by 2016, roughly doubling since 2005.

While the vast majority of shoppers from Accra to Addis Ababa still frequent traditional markets, habits are changing.

At the Shoprite mall on Victoria Island in Lagos, Nigeria’s biggest city, high-end brand clothes hang elegantly in air-conditioned boutiques.

“I like this place because it is comfortable. You don’t need to sweat like in the market. It’s nice and cool, a much better experience than what you get in the outdoor markets,” said Onyeka Achife, 28, a student and businesswoman at the mall.

Africa’s No1 oil producer Nigeria, a country of 170mn, has the continent’s largest middle class outside of South Africa, but it had only a single mall until a second opened in 2011. Developers say a dozen more could open in 2013.

The mall market in Ghana is currently dominated by a single centre, the 58-shop Accra Mall, which draws up to 1mn visitors a quarter and is so busy on weekends that shoppers can spend two hours navigating the car park.

That dearth of malls in Africa has hampered the sub-Saharan expansion of Massmart, Shoprite Holdings and other big South African retailers.

Massmart still has only 29 stores outside its home market, though it is in talks to take a majority stake in Kenyan supermarket chain Naivas, a deal that would give it a foothold in east Africa’s top economy.

“Access to suitable store sites is a key area of focus for retailers around the globe. This is sometimes more challenging on the African continent,” said Brian Leroni, Massmart’s corporate affairs executive.

Shoprite, Africa’s biggest grocer, has said finding suitable sites is the major impediment to its sub-Saharan growth. While Shoprite has 1,240 stores spread across 18 African countries, more than 1,000 of those are in South Africa.

“We are not in the property business; we prefer to be tenants in shopping malls, but there are few of those around, and so we’d build our own stores in strategic locations, said Neil Schreuder, marketing director at Shoprite.

To overcome the hurdle, Shoprite has put more than $200mn into a property fund to build shopping malls and its own standalone stores in Nigeria.

Not only grocers depend on malls to provide growth opportunities. Clothing retailer Foschini Group plans to double its stores outside its native South Africa in the next three years to about 200, but needs malls to do that.

“We follow shopping malls. Without shopping malls, we would probably have to sit back and watch,” said Ronnie Steyn, the company’s financial director.

Jonathan Ciano, the head of Kenya’s Uchumi Supermarkets, told Reuters the sometimes slow pace of shopping mall developments in east Africa’s biggest economy makes it harder to capitalise on growing prosperity among consumers.

“If someone exceeds the timelines, my growth is heavily affected, and alternative developments come up, so the area becomes less lucrative, yet you are already committed,” he said.

Despite the obstacles, South Africa is providing the investment muscle driving the main expansion of malls in the rest of the continent.

Stanlib, the asset management arm of Africa’s biggest lender Standard Bank, recently launched an Africa-focused development fund with plans to build six to eight malls in Nigeria, Uganda, Ghana and Kenya.

South Africa’s largest asset manager, the state-owned 1.2tn rand ($115bn) Public Investment Corp, also has plans to invest in property on the continent.

South Africa-based Atterbury Group, which recently bought Accra Mall, also has sights set on expansion in Africa. It plans to open in the Ghanaian capital a new mall that will be the city’s biggest, to add to properties from Namibia to Mauritius.

Private equity group Actis, which last year sold its 85% stake in Accra Mall to Atterbury and South African financial services group Sanlam, has deployed a $280mn sub-Saharan Africa property fund on office parks, malls and apartments.

“We have a large target market, rapidly expanding and urbanising and hugely under-supplied with quality real estate,” said Chu’di Ejekam, real estate director at its Lagos office.

Nigeria could take a further 45 to 50 large top-class malls within the next seven years to add to its current total of about three, he said.

Chinese developers and other Asian investors are also looking to invest in African malls, said Knight Frank’s Welborn.

“The Chinese have built the roads, hospitals and schools, so this is the next stage for them.