Key players in Algeria's political drama
Ailing Algerian President Abdelaziz Bouteflika submitted his resignation with immediate effect on Tuesday after unprecedented protests and a call from the army chief for impeachment.
His departure, reported by state media, spells the end of two decades in power that saw him cling on through ill health at the top of Algeria's notoriously opaque ruling elite.
Here are the main players in the political drama:
Bouteflika and his inner circle
Bouteflika, 82, has ruled over Algeria since 1999 with support from his faithful backers, but a string of them deserted him under pressure from the massive street protests since February.
One of the first to abandon him was army chief General Ahmed Gaid Salah who on Tuesday upped the pressure with a demand for Bouteflika, rarely seen in public since suffering a stroke in 2013, to be impeached.
The leader's key ally has long been his younger brother and special adviser Said Bouteflika, 21 years his junior, who was frequently cited as a likely successor to the president.
Discreet and rarely seen in public, Said Bouteflika has exerted increasing influence behind the scenes as his brother's health woes worsened, but the president's resignation could take away much of his power.
After coming to power with the army's backing, Bouteflika gradually shook off the influence of the military top brass.
Gaid Salah was promoted to the post of army forces chief in 2004 just as he was about to be sent into retirement after a reported power struggle between Bouteflika and his predecessor.
He has been a loyal supporter who helped Bouteflika dismantle the powerful DRS intelligence agency which was considered by many as a "state within a state".
Over the years the armed forces chief became one of the regime's most powerful figures, giving clout to his calls for Bouteflika to go.
A military intervention to put an end to street protests, which have been peaceful, has not looked likely.
The army has not seemed to be keen on being dragged into a conflict like the civil war that blighted most of the 1990s.
According to Algeria's constitution the speaker of the upper house of parliament Abdelkader Bensalah should now take over as interim leader for up to 90 days during which a presidential election must be organised.
A seasoned establishment insider Bensalah, 77, has held the speaker position for almost 17 years and has stood in for Bouteflika at numerous events both at home and abroad since the leader's stroke.
Another veteran of the independence struggle, he has served as a lawmaker, ambassador, civil servant and senator during a long career that now sees him propelled from the shadows into the top post.
In 2015 Algerian daily El Watan wrote that "making himself useful at the right time is what he knows how to do, he who rarely speaks on issues related to the management of state affairs".
Algeria's political parties, including opposition movements, have been marginalised by the massive protests that erupted in February after Bouteflika announced a bid for a fifth term in office.
Protesters have lashed out against both Bouteflika's the National Liberation Front (FLN) party and its key coalition ally the National Rally for Democracy (RND) as part of demands for an overhaul of the political system in the country.
Under pressure, the RND and some members of the FLN have deserted the president but failed to win hearts among demonstrators who kept on calling for "change" during near-daily protests.
Opposition parties have not fared much better as protesters accuse some members of failing to stand up to the establishment during Bouteflika's 20-year rule and playing roles within the political system.
Among those they have chastised are Ali Benflis, a former Bouteflika premier who has become one of the president's key rivals, and Abderrazak Makri of the moderate Islamist Movement for the Society of Peace.
The street movement
The protests, largely led by social media savvy young people and including lawyers and other professionals, have piled on the pressure with a succession of massive Friday rallies.
Over the weeks their demands have been met by gestures from the government, including Bouteflika's announced departure, but it is unclear if the protest movement will stop.
The demonstrators have no official spokesperson, although figures such as prominent rights activist Mustapha Bouchachi or opposition politician Karim Tabbou have emerged as possible representatives.