Abu Hurairah reported,

The Prophet ﷺ said, "The Children of Israil were governed by the prophets. Whenever a prophet died, another prophet would succeed him. But there will be no prophet after me. Instead, there will be many caliphs."The companions asked, "What do you command us to do?"He replied, "Fulfill your pledge of allegiance to the first one, then the next. Give them their due rights, for Allah will question them about what He entrusted to their care."

Muslim 4773

Sahih

حدثنا محمد بن بشار حدثنا محمد بن جعفر حدثنا شعبة عن فرات القزاز عن أبي حازم قال

قاعدت أبا هريرة خمس سنين فسمعته يحدث

عن النبي ﷺ قال كانت بنو إسرائيل تسوسهم الأنبياء كلما هلك نبي خلفه نبي وإنه لا نبي بعدي وستكون خلفاء تكثر قالوا فما تأمرنا قال فوا ببيعة الأول فالأول وأعطوهم حقهم فإن الله سائلهم عما استرعاهم

مسلم 4773صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Leadership
Chapter
Fulfilling the pledge of allegiance to the caliphs, the first then the next
Numbering
Darussalam 4773
Muslim 4773