Algeria’s ailing president, Abdelaziz Bouteflika, agreed Monday to step down by the end of the month, yielding to weeks of mass demonstrations demanding his ouster. In a short statement carried by Algeria’s official news agency, the president’s office said that Mr. Bouteflika’s resignation would be “effective before April 28, 2019, the end date of his elected mandate.” Mr. Bouteflika, 82, who has ruled Algeria for 20 years, is paralyzed and has not publicly addressed the country since 2013. The protests began last month after Mr. Bouteflika announced that he would run for a fifth term, and they have escalated each week. With support steadily dropping away from former allies, the final blow for Mr. Bouteflika came last week when the powerful army chief of staff called on the country’s Constitutional Council to declare Mr. Bouteflika unfit to hold office.