Outgoing Algerian President Abdelaziz Bouteflika has asked his country for “forgiveness” in a letter published by the Algerian Press Service.
The president, who has been in power for 20 years, said he was “proud” of his contributions but realised he had “failed in [his] duty”.
He added that he was “leaving the political stage with neither sadness nor fear” for Algeria’s future.
His resignation on Tuesday came after six weeks of anti-government protests.
Last week, Algeria’s army chief, Lt Gen Ahmed Gaed Salah, had called for him to stand down.
In a letter, the 82-year-old president expressed his “gratitude” for “the signs of affection and respect” from his “dear sisters and brothers”.
“To err being human, I ask forgiveness for any failing,” he continued.
Bouteflika also “implored” Algerians “to remain united and never succumb to division” after his resignation.
The octogenarian leader suffered a stroke six years ago and has rarely been in public since.
Pressure had been building since February, when the first demonstrations were sparked by Mr Bouteflika’s announcement that he would stand for a fifth term in national elections.
The president later withdrew his plans and reshuffled Algeria’s cabinet to quell accusations of corruption and cronyism, but resigned this week as protests continued.
Abdelkader Bensalah, chairman of the upper house of parliament, is expected to become caretaker president for three months until elections.