Sahih Muslim 2461
The Book of Zakat
حَدَّثَنِي عُبَيْدُ اللَّهِ الْقَوَارِيرِيُّ، حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ الزُّبَيْرِ، حَدَّثَنَا سُفْيَانُ، عَنْ حَبِيبِ بْنِ أَبِي ثَابِتٍ، عَنِ الضَّحَّاكِ الْمِشْرَقِيِّ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ، عَنِ النَّبِيِّ صلى الله عليه وسلم فِي حَدِيثٍ ذَكَرَ فِيهِ قَوْمًا يَخْرُجُونَ عَلَى فُرْقَةٍ مُخْتَلِفَةٍ يَقْتُلُهُمْ أَقْرَبُ الطَّائِفَتَيْنِ مِنَ الْحَقِّ .
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
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.