Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:16547[Chain 1] Abū al-Ḥasan ʿAlī b. Aḥmad b. ʿAbdān > Aḥmad b. ʿUbayd al-Ṣaffār > Ibn Abū Qumāsh > ʿAmr b. ʿAwn > Khālid [Chain 2] Abū ʿAbdullāh al-Ḥāfiẓ > Abū Bakr b. ʿAbdullāh > al-Ḥasan b. Sufyān > Wahbb. Baqiyyah > Khālid b. ʿAbdullāh > al-Jurayrī > Abū Naḍrah > Abū Saʿīd

[Machine] The Messenger of Allah ﷺ said, "If two caliphs are appointed, then kill the latter of the two."  

البيهقي:١٦٥٤٧أَخْبَرَنَا أَبُو الْحَسَنِ عَلِيُّ بْنُ أَحْمَدَ بْنِ عَبْدَانَ أَنْبَأَ أَحْمَدُ بْنُ عُبَيْدٍ الصَّفَّارُ ثَنَا ابْنُ أَبِي قُمَاشٍ ثَنَا عَمْرُو بْنُ عَوْنٍ عَنْ خَالِدٍ ح وَأَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ أَخْبَرَنِي أَبُو بَكْرِ بْنُ عَبْدِ اللهِ أَنْبَأَ الْحَسَنُ بْنُ سُفْيَانَ ثَنَا وَهْبُ بْنُ بَقِيَّةَ ثَنَا خَالِدُ بْنُ عَبْدِ اللهِ عَنِ الْجُرَيْرِيِّ عَنْ أَبِي نَضْرَةَ عَنْ أَبِي سَعِيدٍ قَالَ

قَالَ رَسُولُ اللهِ ﷺ إِذَا بُويِعَ لِخَلِيفَتَيْنِ فَاقْتُلُوا الْآخِرَ مِنْهُمَا  

رَوَاهُ مُسْلِمٌ فِي الصَّحِيحِ عَنْ وَهْبِ بْنِ بَقِيَّةَ

See similar narrations below:

Collected by Muslim, Suyūṭī
muslim:1853And Hb b. Baqiyyah al-Wāsiṭī > Khālid b. ʿAbdullāh > al-Jurayrī > Abū Naḍrah > Abū Saʿīd al-Khudrī

When oath of allegiance has been taken for two caliphs, kill the one for whom the oath was taken later.  

مسلم:١٨٥٣وَحَدَّثَنِي وَهْبُ بْنُ بَقِيَّةَ الْوَاسِطِيُّ حَدَّثَنَا خَالِدُ بْنُ عَبْدِ اللَّهِ عَنِ الْجُرَيْرِيِّ عَنْ أَبِي نَضْرَةَ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ إِذَا بُويِعَ لِخَلِيفَتَيْنِ فَاقْتُلُوا الآخَرَ مِنْهُمَا  

suyuti:1482a

When oath of allegiance has been taken for two caliphs, kill the one for whom the oath was taken later. (Using translation from Muslim 1853)   

السيوطي:١٤٨٢a

"إذَا بُويع لِخَليِفتين فاقْتُلوا الآخِرَ منْهُما ".  

[حم] أحمد [م] مسلم [ك] الحاكم في المستدرك عن أبي سعيد، [كر] ابن عساكر في تاريخه عن علي والعباس معا، الخطيب عن أنس