After two decades in office, Algeria’s president, Abdelaziz Bouteflika, has announced that he will step down before his current term ends on 28 April, after a succession of loyalists deserted the ailing leader.

Hundreds of thousands of Algerians have taken to the streets in weekly protests which began in late February when Bouteflika launched his bid for a fifth term in office.

Bouteflika, who is 82 and in poor health, has recently lost support from his own allies. Last week the coalition ally of Algeria’s ruling party called for him to resign, piling pressure on the president after the military chief also demanded he be declared unfit for office.

The head of the armed forces, Lt Gen Ahmed Gaïd Salah, said in a televised address on Tuesday that the country’s parliament should invoke article 102 of the constitution, declaring Bouteflika unfit to rule on grounds of ill health.

In a short statement on Monday, the presidency said that Bouteflika would take “steps to ensure state institutions continue to function during the transition period”.

It was unclear who would succeed him, although the Algerian constitution calls for the head of the upper house of parliament to act as interim leader for up to 90 days while a presidential election is organised.

Bouteflika uses a wheelchair and has rarely been seen in public since suffering a debilitating stroke in 2013.

Last month, the president agreed not to stand for a fifth term in elections originally planned for April. But he stopped short of standing down as head of state, saying he intended to stay on until a new constitution was adopted, and protests continued.

The announcement that Bouteflika will relinquish power follows a cabinet reshuffle and the nomination of a new government on Sunday.

But his departure may not be enough to satisfy protesters, whose demands have grown to encompass the departure of the regime around Bouteflika and not just the president himself.

“Algerians will continue to protest for the overthrow of the regime, and for a transitional period led by personalities who agree with the principles of the protest movement,” said the protest movement Mouwatana in a statement, entitled: “They are losing, but we haven’t yet won.”