Hadithcore
Sahih Muslim, 1065 e
sahih

Abu Sa'id al-Khudri reported from the Messenger of Allah (ﷺ) that a group (Khawarij) would emerge from the different parties (the party of Hadrat 'Ali and the party of Amir Mu'awiya), the group nearer the truth between the two would kill them.

حَدَّثَنِي عُبَيْدُ اللَّهِ الْقَوَارِيرِيُّ، حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ الزُّبَيْرِ، حَدَّثَنَا سُفْيَانُ، عَنْ حَبِيبِ بْنِ أَبِي ثَابِتٍ، عَنِ الضَّحَّاكِ الْمِشْرَقِيِّ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ، عَنِ النَّبِيِّ صلى الله عليه وسلم فِي حَدِيثٍ ذَكَرَ فِيهِ قَوْمًا يَخْرُجُونَ عَلَى فُرْقَةٍ مُخْتَلِفَةٍ يَقْتُلُهُمْ أَقْرَبُ الطَّائِفَتَيْنِ مِنَ الْحَقِّ ‏.‏

References2 variants
In-Book Reference
Book 12, Hadith 198
USC-MSA web (English) reference
Book 5, Hadith 2327 (deprecated numbering scheme)