By Lamine Chikhi and Hamid Ould Ahmed
ALGIERS (Reuters) - Algerians took to the streets in celebration on Monday evening after ailing President Abdelaziz Bouteflika announced that he had abandoned his decision to seek a fifth term, bowing to weeks of mass demonstrations against his 20-year rule.
Tens of thousands of people from all social classes have been demonstrating almost daily against Bouteflika's decision to stand in the election, rejecting a stale political system dominated for nearly 60 years by veterans of an independence war against France.
After the announcement, a crowd of demonstrators took to the streets waving a huge Algerian flag. Hundreds of people, young and old, joined the throng, jumping up and down with excitement. Cars beeped their horns in approval.
"Our protests have borne fruit! We defeated the supporters of the fifth term!" said taxi-driver Mohamed Kaci, 50.
Bouteflika, 82, has ruled for 20 years but has rarely been seen in public since suffering a stroke in 2013. His opponents say they do not believe he is in a 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 now be postponed. It did not set a new date.
A new constitution would be submitted to the public for a referendum. He also promised political and economic reforms.
Prime Minister Ahmed Ouyahia resigned and Interior Minister Noureddine Bedoui, who is not known as a member of Bouteflika's inner circle, was named as the new prime minister. Ramtane Lamamra, a diplomatic advisor to Bouteflika, was named deputy prime minister.
Bouteflika also met his army chief of staff, Army Chief of Staff Lieutenant General Gaed Salah.
The veteran leader, who returned to Algeria on Sunday after medical treatment in Switzerland, has watched one long-time ally after another join mass 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 a military coup 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 his rule saw power 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.