Algeria's President Abdelaziz Bouteflika will step down before his mandate expires on 28 April, Algerian state media reports.
The 82-year-old, who has been in power for 20 years, will ensure "continuity of the state's institutions" before he quits, a presidential statement carried by APS news agency said.
The news comes after weeks of mass protests demanding his resignation.
As a result, he had dropped plans to seek re-election for a fifth term.
The elections have been postponed and the government has promised to organise a national conference which would discuss reforms to address the discontent.
Ghana News Headlines
For latest news in Ghana, visit Graphic Online news headlines page Ghana news page
Up until now, it had been unclear when or if he would step down, observers say.
The BBC's Ahmed Rouaba says that many Algerians believe the octogenarian's health has declined to such an extent that he is now being used as a front by a group of businessmen, politicians and military officials known as "le pouvoir" (the power), who do not want to give up their influence.
This group dominates the National Liberation Front (FLN), which has governed Algeria since independence from France in 1962.
The protesters are calling for the departure of not just the president, but also an entire generation of Algerian political leaders, including those who would be in line to succeed him.
The majority of the protesters are young people who are not involved in party politics and say they want a new system of government, not simply someone replacing the ailing president.
Last week, Algeria's army chief of staff, Lt Gen Ahmed Gaed Salah, demanded the president be declared unfit to rule.
Last month, Mr Bouteflika, who has rarely been seen in public since suffering a stroke in 2013, also announced a major cabinet reshuffle.
Protests against Mr Bouteflika began two months ago after the president said he planned to stand for another term.
But people have continued to march even after he agreed not to stand, instead demanding immediate change.