Algerian President Abdelaziz Bouteflika resigned Tuesday after weeks of mass protests against his 20-year rule.
The move accelerated his promise earlier this week to resign before the end of his term on April 28. It followed a demand on Tuesday from the country's military chief, Lt. Gen. Ahmed Gaid Salah, that Bouteflika be declared unfit for office immediately.
"This decision is triggered by my eagerness to prevent that the verbal excesses that unintentionally mark the situation turn into potentially dangerous drifts, and for the protection of persons and property which is the main prerogatives of the State," he wrote in a letter released by state-owned Algeria Press Service.
Hundreds reportedly took to the streets of the capital Algiers in celebration, blaring car horns and waving flags.
Persistent protests began after the 82-year-old Bouteflika announced plans in February to seek a fifth term. He then reversed that decision but had delayed new elections.
Since suffering a stroke in 2013, Bouteflika has rarely been seen in public and has been represented by a portrait at public events.
Under the country's constitution, the speaker of the upper house of parliament, Abdelkader Bensalah, will run the country as interim leader for a maximum of 90 days until new elections are held, France 24 reports. The news site reports that Bensalah has been a Bouteflika loyalist and has taken Bouteflika's place at public events. Bensalah has been leader of the upper house since 2002.
Bouteflika had appointed a caretaker government on Sunday, consisting of 27 ministers and headed by Prime Minister Noureddine Bedoui, another ally of Bouteflika.
But demonstrations are likely to continue as protesters reject any continuation of a government that bears the influence of Bouteflika and his allies.
"We will have a 100 percent democratic transition, this is very important," one man, Selmaoui Seddik, reportedly told Reuters. "We need to remove the whole previous regime and that is the hardest thing."
Protests have notably been peaceful in contrast to other demonstrations against longtime leaders of the Middle East and North Africa.
A group of political elites, business leaders and military officials known as le pouvior has effectively managed the country behind the scenes for years, according to analysts. Bouteflika's party, the National Liberation Front, has ruled the country since gaining independence from France in 1962.