Abd Khayr (may Allah have mercy on him) said: I heard Sayyiduna Ali (may Allah be pleased with him) saying: "Allah Almighty took the soul of His Prophet (peace and blessings be upon him) in the best state in which any prophet among the prophets (peace be upon them) was ever taken. Then Sayyiduna Abu Bakr (may Allah be pleased with him) was made caliph, and he acted according to the way of the Messenger of Allah and His Prophet (peace and blessings be upon him), and Sayyiduna Umar (may Allah be pleased with him) did likewise."
Related hadith on this topic