T HE FIRST great surge of foreign interest in Africa, dubbed the “scramble”, was when 19th-century European colonists carved up the continent and seized Africans’ land. The second was during the cold war, when East and West vied for the allegiance of newly independent African states; the Soviet Union backed Marxist tyrants while America propped up despots who claimed to believe in capitalism. A third surge, now under way, is more benign. Outsiders have noticed that the continent is important and becoming more so, not least because of its growing share of the global population (by 2025 the UN predicts that there will be more Africans than Chinese people). Governments and businesses from all around the world are rushing to strengthen diplomatic, strategic and commercial ties. This creates vast opportunities. If Africa handles the new scramble wisely, the main winners will be Africans themselves.

The extent of foreign engagement is unprecedented (see Briefing). Start with diplomacy. From 2010 to 2016 more than 320 embassies were opened in Africa, probably the biggest embassy-building boom anywhere, ever. Turkey alone opened 26. Last year India announced it would open 18. Military ties are deepening, too. America and France are lending muscle and technology to the struggle against jihadism in the Sahel. China is now the biggest arms seller to sub-Saharan Africa and has defence-technology ties with 45 countries. Russia has signed 19 military deals with African states since 2014. Oil-rich Arab states are building bases on the Horn of Africa and hiring African mercenaries.

Commercial ties are being upended. As recently as 2006 Africa’s three biggest trading partners were America, China and France, in that order. By 2018 it was China first, India second and America third (France was seventh). Over the same period Africa’s trade has more than trebled with Turkey and Indonesia, and more than quadrupled with Russia. Trade with the European Union has grown by a more modest 41%. The biggest sources of foreign direct investment are still firms from America, Britain and France, but Chinese ones, including state-backed outfits, are catching up, and investors from India and Singapore are eager to join the fray.

The stereotype of foreigners in Africa is of neocolonial exploiters, interested only in the continent’s natural resources, not its people, and ready to bribe local bigwigs in shady deals that do nothing for ordinary Africans. The stereotype is sometimes true. Far too many oil and mineral ventures are dirty. Corrupt African leaders, of whom there is still an abundance, can always find foreign enablers to launder the loot. And contracts with firms from countries that care little for transparency, such as China and Russia, are often murky. Three Russian journalists were murdered last year while investigating a Kremlin-linked mercenary outfit that reportedly protects the president of the war-torn Central African Republic and enables diamond-mining there. Understandably, many saw a whiff of old-fashioned imperialism.

However, engagement with the outside world has mostly been positive for Africans. Foreigners build ports, sell insurance and bring mobile-phone technology. Chinese factories hum in Ethiopia and Rwanda. Turkish Airlines flies to more than 50 African cities. Greater openness to trade and investment is one reason why GDP per head south of the Sahara is two-fifths higher than it was in 2000. (Sounder macroeconomic policies and fewer wars also helped.) Africans can benefit when foreigners buy everything from textiles to holidays and digital services.

Even so, Africans can do more to increase their share of the benefits. First, voters and activists can insist on transparency. It is heartening that South Africa is investigating the allegedly crooked deals struck under the previous president, Jacob Zuma, but alarming that even worse behaviour in the Democratic Republic of Congo has gone unprobed, and that the terms of Chinese loans to some dangerously indebted African governments are secret. To be sure that a public deal is good for ordinary folk as well as big men, voters have to know what is in it. Journalists, such as the Kenyans who exposed scandals over a Chinese railway project, have a big role to play.

Second, Africa’s leaders need to think more strategically. Africa may be nearly as populous as China, but it comprises 54 countries, not one. African governments could strike better deals if they showed more unity. No one expects a heterogeneous continent that includes both anarchic battle zones and prosperous democracies to be as integrated as Europe. But it can surely do better than letting China negotiate with each country individually, behind closed doors. The power imbalance between, say, China and Uganda is huge. It could be reduced somewhat with a free-trade area or if African regional blocs clubbed together. After all, the benefits of infrastructure projects spill across borders.

Third, African leaders do not have to choose sides, as they did during the cold war. They can do business with Western democracies and also with China and Russia—and anyone else with something to offer. Because they have more choice now than ever before, Africans should be able to drive harder bargains. And outsiders should not see this as a zero-sum contest (as the Trump administration, when it pays attention to Africa, apparently does). If China builds a bridge in Ghana, an American car can drive over it. If a British firm invests in a mobile-data network in Kenya, a Kenyan entrepreneur can use it to set up a cross-border startup.

Last, Africans should take what some of their new friends tell them with a pinch of salt. China argues that democracy is a Western idea; development requires a firm hand. This message no doubt appeals to African strongmen, but it is bunk. A study by Takaaki Masaki of the World Bank and Nicolas van de Walle of Cornell University found that African countries grow faster if they are more democratic. The good news is that, as education improves and Africans move rapidly to the cities, they are growing more critical of their rulers, and less frightened to say so. In 1997, 70% of African ruling parties won more than 60% of the vote, partly by getting rural chiefs to cow villagers into backing them. By 2015 only 50% did. As politics grows more competitive, voters’ clout will grow. And they will be able to insist on a form of globalisation that works for Africans and foreigners alike.