كتاب الإمارة
33  
The Book on Government
(53)
Chapter: The words of the prophet saws: "A Group of my Ummah will continue to Prevail on the basis of the Truth, and They will not be Harmed by those who oppose them."
(53)
باب قَوْلِهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «لاَ تَزَالُ طَائِفَةٌ مِنْ أُمَّتِي ظَاهِرِينَ عَلَى الْحَقِّ لاَ يَضُرُّهُمْ مَنْ خَالَفَهُمْ»
Sahih Muslim 1923

It has been narrated on the authority of Jabir b. 'Abdullah who said:

I heard the Messenger of Allah (ﷺ) say: A group of people from my Umma will continue to fight In defence of truth and remain triumphant until the Day of judgment.
حَدَّثَنِي هَارُونُ بْنُ عَبْدِ اللَّهِ، وَحَجَّاجُ بْنُ الشَّاعِرِ، قَالاَ حَدَّثَنَا حَجَّاجُ بْنُ مُحَمَّدٍ، قَالَ قَالَ ابْنُ جُرَيْجٍ أَخْبَرَنِي أَبُو الزُّبَيْرِ، أَنَّهُ سَمِعَ جَابِرَ بْنَ عَبْدِ اللَّهِ، يَقُولُ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏ "‏ لاَ تَزَالُ طَائِفَةٌ مِنْ أُمَّتِي يُقَاتِلُونَ عَلَى الْحَقِّ ظَاهِرِينَ إِلَى يَوْمِ الْقِيَامَةِ ‏"‏ ‏.‏
Reference : Sahih Muslim 1923
In-book reference : Book 33, Hadith 249
USC-MSA web (English) reference : Book 20, Hadith 4718
  (deprecated numbering scheme)