كتاب الإمارة
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 1921 a

It has been narrated on the authority of Mughira who said:

I heard the Messenger of Allah (ﷺ) say: A group of people from my Umma will continue to be triumphant over the people until the Command of Allah overtakes them while they are still triumphant.
وَحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا وَكِيعٌ، ح وَحَدَّثَنَا ابْنُ نُمَيْرٍ، حَدَّثَنَا وَكِيعٌ، وَعَبْدَةُ كِلاَهُمَا عَنْ إِسْمَاعِيلَ بْنِ أَبِي خَالِدٍ، ح وَحَدَّثَنَا ابْنُ أَبِي عُمَرَ، - وَاللَّفْظُ لَهُ - حَدَّثَنَا مَرْوَانُ، - يَعْنِي الْفَزَارِيَّ - عَنْ إِسْمَاعِيلَ، عَنْ قَيْسٍ، عَنِ الْمُغِيرَةِ، قَالَ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏ "‏ لَنْ يَزَالَ قَوْمٌ مِنْ أُمَّتِي ظَاهِرِينَ عَلَى النَّاسِ حَتَّى يَأْتِيَهُمْ أَمْرُ اللَّهِ وَهُمْ ظَاهِرُونَ ‏"‏ ‏.‏
Reference : Sahih Muslim 1921a
In-book reference : Book 33, Hadith 246
USC-MSA web (English) reference : Book 20, Hadith 4716
  (deprecated numbering scheme)