The ailing, 82-year-old leader announced he was stepping down in a letter published by APS news agency on Tuesday, just hours after the army chief demanded immediate action to remove him from office.
"My intention ... is to contribute to calming down the souls and minds of the citizens so that they can collectively take Algeria to the better future they aspire to," Bouteflika said in the letter to the president of the Constitutional Council.
"I have made this decision to avoid and prevent the arguments which distort, unfortunately, the current situation, and avoid its turning into serious skirmishes, to ensure the protection of persons and property," he added.
The announcement prompted celebrations in Algeria's capital, Algiers, with hundreds of people singing songs and waving flags in front of the city's central post office.
"This is a victory for my country," said 25-year-old Kamel, who only gave his first name. "We now want the rest of the old guard to leave, we also want the corrupt businessmen to be judged. We have won one political battle, not yet the war."