Algerian President Abdelaziz Bouteflika abandoned his bid for a fifth term in power on Monday, bowing to weeks of mass demonstrations against his 20-year rule by people demanding a new era of politics in a country dominated by the old guard.
He also postponed an election that had been set for April, and promised social and economic reform.
>> Algeria’s aging leader could spark a belated Arab Spring | Analysis
"Our protests have borne fruit! We defeated the supporters of the fifth term!" said taxi-driver Mohamed Kaci, 50.
Tens of thousands of people from all social classes have demonstrated almost daily against Bouteflika's plan to run for re-election, rejecting a political system dominated for nearly 60 years by veterans of the independence war against France.
- 'Algeria's rebirth': Tens of thousands call on President Bouteflika to step down
- Amid mass protests, Algeria's Bouteflika promises to leave within year if re-elected
- Tens of thousands protest in Algeria as Bouteflika declares bid for 5th term
Bouteflika, 82, has ruled for 20 years but has rarely been seen in public since suffering a stroke in 2013.
His opponents said they did not believe he was fit state to run the country, one of Africa's biggest oil producers, and suspected he was being kept in place to protect the grip of the military and business elite.
In a series of announcements on Monday evening, the presidency said the election, previously set for April, would be postponed. A new constitution would be submitted to the public for a referendum.
Prime Minister Ahmed Ouyahia resigned and Interior Minister Noureddine Bedoui, not known as a member of Bouteflika's inner circle, replaced him. Ramtane Lamamra, a diplomatic advisor to Bouteflika, was named deputy prime minister.
Bouteflika met Army Chief of Staff Lieutenant General Gaed Salah and veteran Algerian diplomat Lakhdar Brahimi, the kind of widely respected figure the military might look to as a guarantor of stability.
"The voice of the people was has been heard," Brahimi, a former foreign minister and UN special envoy, said on state television after meeting Bouteflika.
"Young people who took to the streets acted responsibly and gave a good image of the country. We must turn this crisis into a constructive process."
Bouteflika's statement said his last duty was to contribute to the founding of a new republic and a new system that would be "in the hands of new generations of Algerians".
A national conference will oversee the transition, draft a new constitution and set the date for elections. It should finish its work by the end of 2019, with elections to follow.
The conference would be headed by an "independent, consensual and experienced national figure", the statement said.
The protests have mostly been peaceful and Bouteflika's announcement should have defused the potential for a bloody showdown with security forces, as has been the case in several other Arab nations facing political upheaval in recent years.
Former colonial ruler France welcomed Bouteflika's decision.
"France expresses its hope that a new dynamic that responds to the aspirations of the Algerian people can get under way quickly," Foreign Minister Jean-Yves Le Drian said.
Some of those celebrating on the streets struck a note of caution, saying they wanted a complete overhaul of the political system.
"We have won the battle. This will be a sleepless night," said 25-year-old Abdelghani Hachi. Nearby, other young Algerians made V-for-victory signs.
Bouteflika, who returned to Algeria on Sunday after medical treatment in Switzerland, has watched one long-time ally after another join the demonstrations calling on him to step down.
More than 1,000 judges said on Monday they would refuse to oversee the election if Bouteflika stood. Clerics said they would not accept government orders about what to preach.
The protests have shattered years of political inertia and unsettled Algeria's opaque but powerful security establishment.
The demonstrations have been the biggest in Algeria since an election was annulled by the military in 1991, triggering a decade of civil war against Islamists in which 200,000 people were killed.
Bouteflika oversaw the end of the war but under his rule power was concentrated in the hands of a secretive military-based establishment known to Algerians as "le pouvoir" -- the powers-that-be.
The security forces have been mostly restrained during the demonstrations, a signal of the establishment's eroding willingness to keep the president in power through force.