Algeria's President Abdelaziz Bouteflika will resign before his fourth term expires on April 28, his office has said in a statement carried by the official APS news agency.
The president will take "steps to ensure state institutions continue to function during the transition period", said the statement issued on Monday, adding, his "resignation would occur before April 28, 2019".
The move comes after Algeria's powerful army chief proposed launching a constitutional procedure to have Bouteflika declared unfit for office. That proposal prompted tensions between the army and the president's inner circle.
The Algerian constitution calls for the head of the upper house of parliament to act act as interim leader for a maximum of 90 days while an election is organised.
Al Jazeera's Imran Khan, reporting from Tunis, said that although Bouteflika's resignation was one of the demonstrators' demands, the protest movement will continue as Algerians view the entire establishment as being part of the problem.
"[The problem includes] people who are seen as being close to him. That includes opposition in government and the army as well," Khan said.
"The government will be hoping that this might have some sort of an impact, [but] everything suggests that it won't have any impact on Algeria's protests."
The protests have been driven mostly by young Algerians, who make up a growing part of the population.
Demonstrators say Bouteflika and his generation are out of touch with the problems of the people.
Many Algerian youth struggle to find jobs, and desperation has driven some to attempt to migrate to Europe on rickety boats.
During Bouteflika's 20 years in office, age and illness took its toll on the once-charismatic figure. Corruption scandals related to infrastructure and hydrocarbon projects have also dogged him for years and tarnished many of his closest associates.
Algeria is Africa's biggest country by land mass and a major natural gas producer, but its energy riches have not trickled down to reach the pockets of its people.