Hadithcore
Mishkat al-Masabih, 3675

Abu Huraira reported the Prophet (ﷺ) as saying, “The B. Isra’il were governed by the prophets, as often as one died another taking his place. There will be no prophet after me, but there will be numerous caliphs.” He was asked what command he had to give and replied, “Fulfil the oath of allegiance to each and give them their due for God will question them about what He asked them to guard.” (Bukhari and Muslim.)

وَعَنْ أَبِي هُرَيْرَةَ عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: «كَانَتْ بَنُو إِسْرَائِيلَ تَسُوسُهُمُ الْأَنْبِيَاءُ كُلَّمَا هَلَكَ نَبِيُّ خَلَفَهُ نبيٌّ وإِنَّه لَا نبيَّ بعدِي وسيكون حلفاء فَيَكْثُرُونَ» قَالُوا: فَمَا تَأْمُرُنَا؟ قَالَ: «فُوا بَيْعَةَ الْأَوَّلِ فَالْأَوَّلِ أَعْطُوهُمْ حَقَّهُمْ فَإِنَّ اللَّهَ سَائِلُهُمْ عَمَّا استرعاهم»

References1 variant
In-Book Reference
Book 18, Hadith 15