THE SCRIPT was all too familiar. First, ordinary Sudanese awoke to find that Abdalla Hamdok, the prime minister appointed by protest leaders two years ago, had been arrested by the army. So had several of his colleagues, including the information minister, who was reportedly dragged barefoot from his home. Then the internet was switched off and bridges into the capital, Khartoum, were closed. So was its airport. “What is happening now in Sudan is a military coup,” said Nasredeen Abdulbari, the justice minister. By mid-morning on October 25th demonstrators had already taken to the streets. Burning tyres and chanting slogans, such as “retreat is impossible”, they advanced in their thousands towards the army’s headquarters, ducking volleys of gunfire.

The scenes recall the heady days of 2019, when protesters from all over Sudan marched over the bridges crossing the Nile to topple a dictator. That was the revolution which deposed Omar al-Bashir, a ruthless Islamist despot who ruled Sudan for three decades. Out of it emerged a power-sharing pact struck in August 2019 between leaders of the protesters and the generals who staged a coup when it became clear that Mr Bashir would fall. At the helm of this fragile arrangement stood Lieutenant-General Abdel-Fattah al-Burhan, Sudan’s de facto president and chairman of the sovereign council, a military and civilian body charged with overseeing Mr Hamdok’s mostly civilian cabinet. Mr Burhan was originally supposed to hand over to a civilian this year and organise elections in 2022. Instead he has mounted a second coup, one that may spell the end of Sudan’s third attempt at democracy since independence from Britain in 1956.

In a televised address Mr Burhan dissolved the transitional government and declared a state of emergency. Claiming that the army had acted because of squabbling among the civilian politicians, he promised to appoint a cabinet of technocrats and to hold elections in 2023. The information ministry, however, called for the release of detainees. The office of Mr Hamdok, who was detained in an undisclosed location along with his wife after having refused to endorse the coup, urged Sudanese civilians “to take back their revolution from the thieves”. So far three people have reportedly been killed and 80 wounded in clashes in Khartoum.

This sequence of events is one familiar to Sudanese people, who saw previous democratic revolutions in 1964 and 1985 also succumb to military takeovers. For months it had been obvious that divisions within the interim government were likely to spill over into violence or lay the ground for a coup. In an interview with The Economist in July, the vice-chairman of the sovereign council, Muhammad Hamdan Dagalo (known as Hemedti), warned of a takeover by people tied to the old regime. But this was almost certainly disingenuous. It was always more likely that Mr Dagalo would join forces with Mr Burhan to oust the civilians. Mr Dagalo does not have much form as a democrat. He is a desert warlord who heads a notorious paramilitary unit called the Rapid Support Forces (RSF), which grew out of the Janjaweed, a militia responsible for genocide in Sudan’s Darfur region.

The opening salvo was fired last month, when the army announced that it had foiled a coup attempted by Islamists loyal to Mr Bashir. Many suspect that it was in fact a ploy by the generals themselves to tighten their grip on the government. Soon afterwards Mr Dagalo said blame for the attempted coup lay with civilian leaders, for their bickering and mismanagement of public services. On October 11th, in a speech to senior army officers, Mr Burhan called for the cabinet to be dissolved and warned against efforts to exclude the army from the transition. Five days later protesters were shipped in by the army to stage a demonstration outside the presidential palace calling for a military takeover. Many Sudanese suspect this was a pre-emptive effort to whitewash the coming coup.

Mr Burhan and Mr Dagalo have been preparing in other ways, too. An agreement signed last year with rebels from Darfur and southern Sudan brought more men with guns into the power-sharing government, apparently as their allies. The two have also been amassing greater economic power. Firms that once belonged to Mr Bashir’s family have been swept up by the armed forces. Profits from military-owned companies, which were once channelled to the ruling party, now flow directly to the army’s own coffers. Mr Dagolo’s RSF has been expanding its business interests too. Few doubted that Mr Hamdok’s efforts to rein them in, and to launch investigations into the army’s role in massacres under the previous regime, could spell trouble.

The timing of the coup has nonetheless raised eyebrows. In the past week thousands demonstrated in Khartoum against the armed forces in the largest protest since 2019. It also came less than two days after the visit of Jeffrey Feltman, America’s special envoy to the Horn of Africa, during which he warned against a coup and expressed America’s support for the transition to civilian rule. Since Mr Bashir’s downfall, the generals as well as civilian politicians have been anxious to repair ties with the West after decades of sanctions. Speaking to The Economist in July Mr Burhan crowed that Sudan’s “international isolation…is now over.” His government has mended ties with Israel and persuaded America to remove Sudan from its list of state sponsors of terrorism. Yet much of that progress may be swiftly undone by this coup. As reports of it emerged Mr Feltman expressed his deep alarm and warned that America might cut aid to Sudan in response to the coup. That the generals were so brazen as to risk antagonising Sudan’s biggest donor suggests they are confident of having the staunch backing of allies such as Saudi Arabia, the United Arab Emirates and Egypt. “Without regional cover Burhan would not do this,” says Magdi el-Gizouli of the Rift Valley Institute, a think-tank based in London and Nairobi.

In grabbing power, Mr Burhan has made an already combustible region even more so. The African Union has its hands full with wartorn Ethiopia next door. A border dispute between Ethiopia and Sudan has been aggravated by the internal tensions of both countries, which have moved troops to the area. Skirmishes have broken out in recent months and may spark a full-blown war.

Meanwhile much of Sudan itself is ready to ignite. Some 430,000 people have been uprooted this year by various internal conflicts, such as fighting between farmers and cattle herders, a faster rate of displacement than in any year in more than a decade.

Popular protests against the coup will almost certainly lead to further violence and repression: in 2019 the security forces fired on people who were protesting peacefully against the rule of the military, killing more than 100. Then there is the risk that Sudan’s potpourri of militia and security forces might turn their guns on one another. Mr Burhan and General Dagalo may be working together on this coup, as they did in the previous one, but there is little love, or trust, between them. The Sudanese spring, until recently a source of hope in a troubled region, is turning into a winter.