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."
Translation: "President of the Republic, Abdelaziz Bouteflika, officially notified the president of the constitutional council his decision to end his mandate as president of the Republic."
'No room to waste time'
The anti-Bouteflika protests broke out in late February when the longtime president, who has rarely been seen in public since suffering a stroke in 2013, announced a plan to seek a fifth term in elections scheduled for April.
Hundreds of thousands of people, for several weeks, took to the streets of Algiers and other major cities calling for the president's resignation.
On March 11, Bouteflika sought to defuse the unrest by abandoning his re-election bid. However, he delayed the presidential vote indefinitely and announced he would only step down once a new constitution had been passed and a successor had been elected.
But public anger continued to mount, prompting key allies to abandon the president.
Ahmed Gaid Salah, the army's chief of staff, last week called for Bouteflika to be declared unfit to rule, and on Monday, the embattled leader said he would quit before the end of his term on April 28.
|Algerians have been protesting against Bouteflika since late February [Ryad Kramdi/ AFP]|
On Tuesday, Salah again reiterated his demand for impeachment proceedings, saying: "There is no more room to waste time."
He added: "We decided clearly ... to stand with the people so all their demands get fulfilled."
Pressure had been building during the day on Tuesday with opposition groups demanding Bouteflika go immediately, while hundreds of students marched through Algiers to demand to the replacement of a political system widely seen as incapable of significant reform.
Bouteflika's resignation will put his ally, Abdelkader Bensalah, chairman of the upper house of parliament, in charge as caretaker president for 90 days until elections are held.
Nazim Taleb of the opposition Rachab movement, speaking to Al Jazeera from Algiers, said a transitional council was necessary to pave the way for a free and fair election in the country.
"Bensalah and the army will not facilitate a free election. Bouteflika's most trusted people are still part of the system. They don't want a free election because they might end up in jail," he said.
The Algerian people "want oversight of the election, to control the process so there can be a fair vote that reflects the people's will," Taleb said, adding that the Rachab movement was open to including representatives of the army in any transitional body.
Francis Ghiles, researcher at the Barcelona Centre for International Affairs, said such an interim council should include elderly statesmen who "have historical legitimacy" as well as "younger members of society, such as human rights lawyers, to create a transitional administration that is credible in the eyes of the millions who have been in the streets for six weeks now".
He said Algeria lacked an organised opposition because Bouteflika had "smashed every bit of opposition or bought them out".
"The great challenge for Algeria is to organise this transition, bearing in mind there are no strong well-constituted parties," Ghiles told Al Jazeera from the Spanish capital, Madrid.
Meanwhile, Benjamin Brower, a historian at the University of Texas, said he feared Salah, the army chief, was positioning himself to take control of Algeria.
"He precipitated Bouteflika's resignation today with a speech that he gave earlier in the day calling for an immediate step down of the president," Brower told Al Jazeera.
"I think that's a person who wants to see himself in some kind of power. But I think the question is whether that's ratified by the demonstrators in the street who have an immense energy and momentum moving into this after six weeks of demonstrations where they've really driven the political events forward in a way that we haven't seen in Algeria perhaps ever."
In Algiers, 65-year-old Halima said she intended to continue to protest until Bouteflika's allies also stepped down.
"We are turning a page in Algeria's history," she told Al Jazeera.
"Bouteflika's removal is not enough. We want all the veterans to leave ... It is now time for a new generation of leaders to take over."
|Bouteflika comes out from a polling booth before casting his vote at a polling station in Algiers, Algeria, 29 November 2012 [File: Mohamed Messara/EPA]|
Djamila Ould Khettab contributed in this report from Algiers.