Abd Khayr narrates: Sayyiduna Ali bin Abi Talib (may Allah be pleased with him) stood on the pulpit and, mentioning the Prophet (peace and blessings be upon him), said: When the Prophet (peace and blessings be upon him) passed away, Sayyiduna Abu Bakr (may Allah be pleased with him) was appointed caliph. He acted according to the practice of the Prophet (peace and blessings be upon him) and followed his way, until Allah Almighty took his soul in that very state. Then Sayyiduna Umar (may Allah be pleased with him) was appointed caliph, and he acted according to the way of those two and followed the ways of both of them, until Allah Almighty took his soul as well.
Imam Ahmad recorded it, and its narrators are thiqat (trustworthy).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الخلافة / 8908