Sahih Muslim , Hadith 1839 ⓘ
It has been narrated on the authority of Ibn 'Umar that the Prophet said: It is obligatory upon a Muslim that he should listen (to the ruler appointed over him) and obey him whether he likes it or not, except that he is ordered to do a sinful thing. If he is ordered to do a sinful act, a Muslim should neither listen to him nor should he obey his orders.
حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، عَنْ عُبَيْدِ اللَّهِ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، عَنِ النَّبِيِّ صلى الله عليه وسلم أَنَّهُ قَالَ " عَلَى الْمَرْءِ الْمُسْلِمِ السَّمْعُ وَالطَّاعَةُ فِيمَا أَحَبَّ وَكَرِهَ إِلاَّ أَنْ يُؤْمَرَ بِمَعْصِيَةٍ فَإِنْ أُمِرَ بِمَعْصِيَةٍ فَلاَ سَمْعَ وَلاَ طَاعَةَ " .
also referenced under: Book 33, Hadith 61 (In-Book) & Book 20, Hadith 4533 (USC-MSA)
This hadith has been transmitted on the authority of 'Ubaidullah.
وَحَدَّثَنَاهُ زُهَيْرُ بْنُ حَرْبٍ، وَمُحَمَّدُ بْنُ الْمُثَنَّى، قَالاَ حَدَّثَنَا يَحْيَى، وَهُوَ الْقَطَّانُ ح وَحَدَّثَنَا ابْنُ نُمَيْرٍ، حَدَّثَنَا أَبِي كِلاَهُمَا، عَنْ عُبَيْدِ اللَّهِ، بِهَذَا الإِسْنَادِ مِثْلَهُ .
also referenced under: Book 33, Hadith 62 (In-Book) & Book 20, Hadith 4534 (USC-MSA)