Abu Hazim reported,

I sat with Abu Hurayrah for five years and heard him narrate from the Prophet ﷺ, who said, "The Children of Israil were governed by the prophets. Whenever a prophet died, another prophet succeeded him. But there will be no prophet after me. Instead, there will be caliphs, and they will be many."The companions asked, "What do you command us to do?"He said, "Fulfill the pledge of allegiance to the first one, then the next. Give them their due, for Allah will question them about what He entrusted to their care."

Bukhari 3455

Sahih

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

أبا حازم قال

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

البخاري 3455صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Hadiths of the prophets
Chapter
Children of Israil
Numbering
Darussalam 3455
Bukhari 3455