How Algeria's army sacrificed a president to keep power
When the head of Algeria's army declared the president was too ill to rule he revealed where the real power lies in Algeria, writes James McDougall, an expert on the history of Algeria.
For Algeria's 82-year old former President Abdelaziz Bouteflika, it is "game over", as slogans on the country's streets have been saying since mid-February.
But his resignation, announced on Tuesday, does not mean the end of the protests that have seen hundreds of thousands of people, of all ages, peacefully demonstrating for seven weeks.
Early in the movement demonstrators' slogans demanded "No fifth mandate".
They were rejecting Mr Bouteflika's candidacy for re-election to a fifth term in the presidency he had occupied since 1999.
You may also be interested in:
But from the start, the protests were about more than Mr Bouteflika.
The whole "system", or "pouvoir", had to go, placards and online posts demanded.
So when the army's chief of staff, Lt Gen Ahmed Gaid Salah, announced on 26 March that article 102 of the constitution - allowing the president's removal on grounds of ill health - should be applied, protesters had won something, but their response was cautious.
The following Friday, marchers in the country's second city, Oran, carried signs saying: "102 is half the answer, the whole gang has to go."
The hashtags now were: "Leave means Leave" and "Throw them all out".
Protesters in the capital, Algiers, chanted: "Bouteflika get out, and take Gaid Salah with you."
A second statement from Gen Gaid Salah demanded the "immediate" application of article 102.
Mr Bouteflika's resignation followed a few hours later.
At 79-years old, Gen Gaid Salah, like Mr Bouteflika, is one of the last remaining veterans of Algeria's revolutionary generation who fought in the war of independence against France from 1954 to 1962.
Ever since independence, the army has been the real centre of power in Algeria, arbitrating factional conflicts among politicians and business interests, making and unmaking presidents.
Mr Bouteflika himself was brought to the presidency in 1999 by a group of generals who had prosecuted a brutal war against militant Islamist insurgents since 1992.
After that conflict wound down, the army preserved its power, acting behind the scenes to distribute influence through Algeria's multiparty politics and the "system" of factional interests that it represents.
But the army is not the only player in that system, and in the early 2000s Mr Bouteflika removed the generals who had sponsored him.
A presidential "clan", including wealthy private businessmen, gravitated around Mr Bouteflika and his brother Said.
After Mr Bouteflika suffered an incapacitating stroke in 2013, Said was increasingly identified as being in control of access and influence at the centre of power.
Gen Gaid Salah, head of the army since 2004, was a central figure in this system.
Until last week, he was strongly identified with the president and his circle.
His decision to cut the president loose and declare the army "aligned" with the aspirations of the popular movement signalled a recognition that radical measures were needed to save the system.
On the day Mr Bouteflika resigned, a high-profile businessman associated with Said's clique was arrested.
Others had their passports confiscated and were forbidden to leave the country.
While some protesters welcomed the army's move, there were also demands that "the army's place is in the barracks" and widespread rejection of an attempt to keep control over the transition by those still in power.
By ousting Mr Bouteflika and casting his other close associates adrift, Gen Gaid Salah no doubt intends to recapture the initiative from the street.
Slogans now include: "The army and the people are brothers, brothers" and "the army and the people are one hand".
These chants might be a vote of confidence in the general's actions.
But they can also be heard as a call for the army to really align itself with the people, rather than manoeuvring against them.
Other placards read "Neither Gaid nor Said" and "system get out".
While denouncing cliques of private interests, Gen Gaid Salah claims that Algeria's army is "modern and professional".
Some, perhaps including many officers, no doubt detest the image of an Algeria ruled by an incapacitated figurehead for the crony capitalists around his brothers.
They do not see themselves as the "thieves" who have, as protesters chant, "pillaged the country".
Some observers and activists believe that the army as an institution now wants to stay out of politics and might even support the "clean-up" of corruption that protesters demand.
Gen Gaid Salah's demand for the immediate application of article 102 also mentioned articles seven and eight of the constitution.
These formally state that sovereignty in Algeria rests with the people.
The popular movement's demands have been far-reaching from the start, and its momentum has been sustained from one week to the next, with students, lawyers, judges, journalists, academics and even fire-fighters and army veterans demonstrating on the days between each massive Friday protest.
A popular slogan is: "1962: country liberated, 2019: people liberated."
The big question now is whether Algeria's army will permit a transition that really gives sovereignty to the people.
James McDougall is a professor of Modern History at Oxford University and author of A History of Algeria.