Sahih Muslim 1855 b
It has been narrated on the authority of Auf b. Malik al-Ashja'i who said that he heard the Messenger of Allah (ﷺ) say:
The best of your rulers are those whom you love and who love you, upon whom you invoke God's blessings and who invoke His blessing upon you. And the worst of your rulers are those whom you hate and who hate you, who curse you and whom you curse. (Those present) said: Shouldn't we overthrow them at this? He said: No, as long as they establish prayer among you. No, as long as they establish prayer among you. Mind you! One who has a governor appointed over him and he finds that the governor indulges in an act of disobedience to God, he should condemn the governor's act, in disobedience to God, but should not withdraw himself from his obedience. Ibn Jabir said: Ruzaiq narrated to me this hadith. I asked him: Abu Miqdam, have you heard it from Muslim b. Qaraza or did he describe it to you and he heard it from 'Auf (b. Malik) and he transmitted this tradition of Allah's Messenger (ﷺ)? Upon this Ruzaiq sat upon his knees and facing the Qibla said: By Allah, besides Whom there is no other God, I heard it from Muslim b. Qaraza and he said that te had heard it from Auf (b. Malik) and he said that he had heard it from the Messenger of Allah (ﷺ).
حَدَّثَنَا دَاوُدُ بْنُ رُشَيْدٍ، حَدَّثَنَا الْوَلِيدُ، - يَعْنِي ابْنَ مُسْلِمٍ - حَدَّثَنَا عَبْدُ الرَّحْمَنِ بْنُ، يَزِيدَ بْنِ جَابِرٍ أَخْبَرَنِي مَوْلَى بَنِي فَزَارَةَ، - وَهُوَ رُزَيْقُ بْنُ حَيَّانَ - أَنَّهُ سَمِعَ مُسْلِمَ بْنَ، قَرَظَةَ ابْنَ عَمِّ عَوْفِ بْنِ مَالِكٍ الأَشْجَعِيِّ يَقُولُ سَمِعْتُ عَوْفَ بْنَ مَالِكٍ الأَشْجَعِيَّ، يَقُولُ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏"‏ خِيَارُ أَئِمَّتِكُمُ الَّذِينَ تُحِبُّونَهُمْ وَيُحِبُّونَكُمْ وَتُصَلُّونَ عَلَيْهِمْ وَيُصَلُّونَ عَلَيْكُمْ وَشِرَارُ أَئِمَّتِكُمُ الَّذِينَ تُبْغِضُونَهُمْ وَيُبْغِضُونَكُمْ وَتَلْعَنُونَهُمْ وَيَلْعَنُونَكُمْ ‏"‏ ‏.‏ قَالُوا قُلْنَا يَا رَسُولَ اللَّهِ أَفَلاَ نُنَابِذُهُمْ عِنْدَ ذَلِكَ قَالَ ‏"‏ لاَ مَا أَقَامُوا فِيكُمُ الصَّلاَةَ لاَ مَا أَقَامُوا فِيكُمُ الصَّلاَةَ أَلاَ مَنْ وَلِيَ عَلَيْهِ وَالٍ فَرَآهُ يَأْتِي شَيْئًا مِنْ مَعْصِيَةِ اللَّهِ فَلْيَكْرَهْ مَا يَأْتِي مِنْ مَعْصِيَةِ اللَّهِ وَلاَ يَنْزِعَنَّ يَدًا مِنْ طَاعَةٍ ‏"‏ ‏.‏ قَالَ ابْنُ جَابِرٍ فَقُلْتُ - يَعْنِي لِرُزَيْقٍ - حِينَ حَدَّثَنِي بِهَذَا الْحَدِيثِ آللَّهِ يَا أَبَا الْمِقْدَامِ لَحَدَّثَكَ بِهَذَا أَوْ سَمِعْتَ هَذَا مِنْ مُسْلِمِ بْنِ قَرَظَةَ يَقُولُ سَمِعْتُ عَوْفًا يَقُولُ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ فَجَثَا عَلَى رُكْبَتَيْهِ وَاسْتَقْبَلَ الْقِبْلَةَ فَقَالَ إِي وَاللَّهِ الَّذِي لاَ إِلَهَ إِلاَّ هُوَ لَسَمِعْتُهُ مِنْ مُسْلِمِ بْنِ قَرَظَةَ يَقُولُ سَمِعْتُ عَوْفَ بْنَ مَالِكٍ يَقُولُ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم ‏.‏