Crowds rejoiced after a group of colonels seized power in Mali, a vast country stretching into the Sahara, where troops - including French soldiers and UN peacekeepers - are fighting jihadist groups, but not everyone is happy, writes West Africa analyst Paul Melly.
Negotiations are rumoured to be under way for the exile of Ibrahim Boubacar Keïta, deposed as president of Mali in a military putsch on Tuesday and currently detained with his son, his Prime Minister Boubou Cissé and a number of other senior government officials.
But now Ecowas, the West African regional bloc to which Mali belongs, has laid down a firm line, with member heads of state issuing a call for Mr Keïta's reinstatement as president.
The weary-sounding 75-year-old had announced his enforced resignation in a televised statement around midnight on Tuesday, apparently from a room at the Kati army base, 15km (nine miles) from Bamako, where he and Mr Cissé had been taken by soldiers that afternoon.
This came after more than two months of confrontation with an alliance of opposition politicians and civil society, the M5-RFP, in whose name massive crowds staged a series of street demonstrations shrewdly piloted by the charismatic imam Mahmoud Dicko.
Protesters had only one central demand - Mr Keïta's resignation, although Mr Dicko held back from explicitly calling for this himself.
In negotiations mediated by Ecowas, Mr Keïta had made concession after concession, but never ceding either his own position or the decisive reforms that would have clearly ended his command of the state machine.
You may also be interested in:
That was no longer enough and finally a group of senior - but not top-ranking - officers, moved to end his occupation of the presidency.
But Ecowas is not prepared to go along with this unconstitutional change of power and its envoy, former Nigerian President Goodluck Jonathan, is soon expected back in Bamako to talk to the putchists.
Difficult negotiations lie ahead and no-one can be sure how they will pan out.
When gunshots were heard over the Kati barracks on Tuesday it was not immediately obvious that this was anything other than a mutiny by ordinary soldiers' angered by high-level corruption while they risk their lives in the war against jihadists in the north.
But as military vehicles swept from Kati down into Bamako to arrest Mr Keïta and a string of senior figures, it became clear that something much more substantial was under way.
For exasperation with Mr Keïta stretched back much further than the face-off with protesters over recent months.
Faith in the slogans about restoring national pride that had carried him to election victory over the technocratic Soumaïla Cissé back in 2013 had long since faded.
International partners were dismayed by Mr Keïta's failure to use his early popularity to swing politicians and the public behind the difficult compromises required to effectively implement peace with Tuareg separatists in the north, a dilatory approach that left a vacuum in which terrorism could flourish.
More about Mali's battle against jihadists
But for Malians, particularly in the south and the centre, where most live, Mr Keïta's administration was most tarnished by a string of corruption scandals, sometimes undermining basic services such as the supply of fertiliser to poor farmers, amidst stories about the ostentatious high life of the ruling elite.
The president only secured easy re-election in 2018 because traditional opponents and a raft of new centrist groups failed to establish a common front.
The issue that finally triggered the massive upsurge of popular anger that spilled on to the streets of Bamako this year was a rather narrowly political one - the decision of the Constitutional Court to overturn the results for 31 parliamentary seats in the elections held over two rounds in March and April.
This cancelled voters' humiliation of the government in Bamako constituencies - and it came at a moment when feelings were already raw after northern militants had kidnapped opposition leader Soumaïla Cissé while he was out on the campaign trail in the north, near Timbuktu. He is still a hostage now.
Then after Covid-19 had forced Bamako residents to endure lockdown measures, and while Malian soldiers continued to sacrifice their lives in the northern war, images emerged appearing to show the president's son, Karim - chair of parliament's defence committee - on a holiday yacht abroad.
The pictures could not be verified and may have been old.
Karim Keïta himself insisted no public expense had been incurred - yet the images could only further fuel perceptions of a presidential circle somehow unengaged and distanced from Mali's multiple crises.
Throughout all this Mr Keïta's prime minister struggled assiduously to broker a political path forward and tackle the country's real problems. But Boubou Cissé lacked the independent personal clout to save the beleaguered administration.
Ecowas mediation was making progress, but slowly - and then, this week, the soldiers stepped in.
So where does Mali go from here?
The National Committee for the Salvation of the People (CNSP)
Col Assimi Goita:Head of the CNSP and leads Mali's special forces
Col Malick Diaw:CNSP vice-president; deputy head of camp where mutiny began
Col Ismaël Wagué:Junta's spokesman; from the air force (pictured)
Col Sadio Camara:Ex-head of the military academy where the mutiny started
Col Modibo Koné:Has played a key role in fighting jihadists
For the very short term the UN's large Mali peacekeeping mission, French anti-terrorist forces and national military units deployed in the north and the centre should be able to maintain a stable security position.
But the position is fragile and jihadist groups will take heart if there is a prolonged delay in agreeing arrangements for a transition, new elections and an internationally accepted interim government.
One person who has already signalled that he will not take a frontline role at this stage is Mr Dicko.
The influential imam has declared his intention to step back from politics for now, although he will remain an influential figure, if and when he chooses to exert that influence.
In the meantime, much hangs on the talks now expected between the putschists, the M5-RFP and Ecowas.