Algeria's President Abdelaziz Bouteflika is resigning after weeks of mass protests, state media report.
Mr Bouteflika, who has been in power for 20 years, had already dropped plans to seek a fifth term as opposition to his rule grew.
The powerful Algerian army had called for the 82-year-old to be declared incapable of carrying out his duties.
The ailing leader suffered a stroke six years ago and has rarely appeared in public since.
Car horns could be heard in the streets of the capital, Algiers, as hundreds celebrated the announcement.
People waved Algeria's national flags and sang.