O N THE STREETS of Khartoum, the capital of Sudan, people are breathing a heady mix of fear and hope. Since April 11th, when a cabal of army officers pushed out the 75-year-old Omar al-Bashir, the country’s president for the past 30 years, Sudan has had two more of its bloodied leaders step down. On April 12th, just a day after taking control, Awad Ibn Auf, the defence minister and head of the self-appointed “transitional military council”, resigned. The next day, so did Salah Abdallah Gosh, the head of the much-feared National Intelligence and Security Service ( NISS ).

On April 13th the latest military leader, Abdel Fattah Abdelrahman Burhan, announced his intention to “uproot” the military government, prosecute those guilty of killing protesters and reform the NISS . He has promised to hand power over to civilians within two years. The protesters camped outside the defence ministry over the past week have succeeded in changing their country.

Yet they have plenty to worry about. “There are so many militias, so many armed groups, it’s very scary,” says Hamid Murtada, an activist among those protesting. Fights have already broken out between soldiers affiliated with different parts of the Sudanese state. Gunfire is heard at night. The soldiers now in charge might concede more to the protesters, perhaps even allowing a civilian government to form. But they might also try to break up protests by force, or even worse, start fighting each other.

Sudan is experiencing something seen in several countries since the Arab spring of 2011: popular protests against an ageing despot precipitating regime change. It follows Algeria, which on April 2nd learned of the resignation of President Abdelaziz Bouteflika, an 82-year-old so inactive that many Algerians joke he is dead. He was forced out by weeks of protests after he informed horrified Algerians that he planned to stand for re-election yet again.

Such transitions offer hope. They show that street movements can effect change, even against brutal regimes. But they are also moments of great risk. The fall of long-standing despots such as Mr Bashir, who is wanted by the International Criminal Court for crimes against humanity, is a necessary part of any transition to democracy. But it can also start a civil war, or lead to a new dictatorship as the next strongman builds his own networks of power.

In general, armies everywhere have proven better at staging coups than at managing genuine transitions to civilian rule. Thailand’s army, which has mounted 19 attempted coups (12 of them successful) since the end of absolute monarchy in 1932, most recently took power in 2014. This March it rigged an election under a constitution it had drafted to make its grip on power more or less permanent. In neighbouring Myanmar, an election and formal transfer of power in 2015 should have marked the end of more than half a century of military rule. But the constitution the army has foisted on the country guarantees it control of important ministries and enough seats in parliament to block reforms. Pakistan’s army, which ruled directly from 1999 to 2008, now relies on less formal mechanisms to ensure its continued sway over the country’s foreign policy, and to protect its economic interests.

In fact, the political turmoil witnessed in the past month bucks long-term trends. Data compiled by Hein Goemans of the University of Rochester and two other scholars `show that two-thirds of national leaders in Africa and the Middle East who lost power between 1960 and 1989 were either forced out or died of natural causes. But since then, democracy has spread. “Irregular exits”, as Mr Goemans calls them, have become much rarer. Most Arab and African leaders now leave office because they are voted out or do not stand for re-election. Analysts counted 18 attempted coups around the world in 1966 and none at all in 2007 or 2018. According to CoupCast, a predictive model based on 68 economic and other variables, Africa is the only continent where the factors that foster coups are still fairly widespread (see map).

In both Sudan and Algeria the cliques now in charge may hope to cling to power despite the change of figurehead. Under Mr Bashir, Sudan has been run less by a government and more by a cartel of different armed groups. The president, says Alex de Waal, an analyst and former peace negotiator, was “the conductor of an orchestra”. Rather than just an army, the country has half a dozen semi-formal military outfits, from the NISS to pro-government militias such as the notorious Janjaweed, responsible for mass rape and massacres in Darfur over a decade ago. Each has its own leaders and weapons. Mr Bashir stayed in power by balancing these groups against each other.

In Algeria institutions are stronger, but authority is still wielded by what Algerians call le pouvoir (the power). This is a shadowy collection of army officers, businessmen and others, continually negotiating among themselves. Any politics involving people outside this clique is crushed.

The two regimes are alike in being based not on strong, visible institutions but on invisible webs of personal relationships. Leaders are less executive decision-makers than dealmakers, playing off different factions against each other so as to keep themselves in power. Offices do not matter as much as the individuals who hold them, and the alliances they have.

Changes of leadership will bring lasting change only if they overturn this politics. Other recent coups offer worrying lessons. In 2017 in Zimbabwe, President Emmerson Mnangagwa came to power after the army forced out Robert Mugabe, who had ruled for 37 years. Mr Mnangagwa, Mr Mugabe’s former chief enforcer, impressed gullible diplomats by promising a “new dispensation” and economic reform. But his election campaign last year was violent and fraudulent. Since then, inflation has soared as promised investment failed to materialise. Renewed protests in January were bloodily put down. Mr Mnangagwa was never serious about reform. He, like Mr Mugabe, relies on a personal patronage network to maintain his grip on power.

Changing the guard

Yet some places do offer hope. In 2014, Blaise Compaoré, the president of Burkina Faso in west Africa, fled the country for Ivory Coast after protesters stormed the parliament building and set it on fire. In that instance, the army took charge but then quickly handed power to a transitional government to organise elections. In September 2015, Mr Compaoré’s supporters in the presidential guard mounted a coup, intended, ultimately, to restore him to office. But though they succeeded in taking Ouagadougou, the capital, the coup plotters eventually had to give up when it became clear that they had no international support. The planned election was held in November of that year.

Could such a thing happen in Sudan or Algeria? In Sudan the African Union ( AU ) is insisting that the men with guns give up power—as it did with Burkina Faso, but noticeably failed to do with Zimbabwe. On April 15th it gave Sudan’s new leaders 15 days to hand over to a “civilian-led political authority” or face suspension. The dramatic fall in the number of coups in Africa over the past two decades owes much to the AU ’s refusal to accept sudden military takeovers. Unrecognised governments struggle to do much (sadly, it is less bothered about other outrages, such as rigged elections).

But even if power were handed over to civilians in Khartoum, the situation in Sudan could still prove dangerous. The protesters there are relatively well-off urbanites angry at the worsening economy. But the rest of the country is desperately poor, barely governed and awash with arms. It is held together by loose alliances, mostly organised by Mr Bashir. And since 2011, when South Sudan was given independence, Khartoum has lost the oil that is its main source of political finance. The danger is that any deal that satisfies the protesters of Khartoum will undermine the fragile half-peace in the periphery. That could stoke new rebellions that would quickly undermine any post-Bashir government. “It’s only a matter of time before Sudan falls again to military rule,” says Muhammad Osman, a Sudanese analyst.

One possible outcome is that the army finds more external sponsorship. Saudi Arabia and the United Arab Emirates would probably bail the new rulers out, in exchange for protection of their interests, chiefly the continued participation of Sudanese soldiers in the Saudi-led coalition in the war in Yemen. With an infusion of new cash, the delicate balancing-act between Sudan’s various armed forces that Mr Bashir had maintained might become somewhat easier. But there is every risk that a miscalculation might spark conflict, especially if one faction feels that it may have to face retribution for its role in previous violence. “People will shoot and defend themselves,” says Harry Verhoeven, an academic and the author of a book, “Water, Civilisation and Power in Sudan”. “These are people who owe everything to this system and the impunity it gave them.”

In Algeria the end of the protest movement already seems nigh. On April 12th police tried to take back the streets of Algiers, the capital, by blocking roads into the city. When that failed, they used water-cannon and tear-gas to drive demonstrators away. Mr Bouteflika’s downfall may usher in some change. But it will take longer than a few weeks. Only when a state has a broad base of support, and power vested in institutions rather than individuals, can a country really be coup-proofed. In Khartoum the people on the street speak of revolution. But they fear failure. “This might all be a game,” says Mr Murtada, the activist. “We can’t leave until we know the plan…We cannot trust the military at all.” Sadly, neither can they trust anyone else.