كتاب الإمارة
33  
The Book on Government
(13)
Chapter: The obligation of staying with the Jama'ah (main body) of the muslims when Fitn (tribulations) appear, and in all circumstances. The prohibition of refusing to obey and on splitting away from the Jama'ah
(13)
باب الأَمْرِ بِلُزُومِ الْجَمَاعَةِ عِنْدَ ظُهُورِ الْفِتَنِ وَتَحْذِيرِ الدُّعَاةِ إِلَى الْكُفْرِ ‏‏
Sahih Muslim 1849 b

It has been narrated (through a different chain of transmitters) on the authority of Ibn Abbas that the Messenger of Allah (may peace be upoh him) said:

One who dislikes a thing done by his Amir should be patient over it, for anyone from the people who withdraws (his obedience) from the government, even to the extent of a handspan and died in that conditions, would die the death of one belonging to the days of jahilliyya.
وَحَدَّثَنَا شَيْبَانُ بْنُ فَرُّوخَ، حَدَّثَنَا عَبْدُ الْوَارِثِ، حَدَّثَنَا الْجَعْدُ، حَدَّثَنَا أَبُو رَجَاءٍ، الْعُطَارِدِيُّ عَنِ ابْنِ عَبَّاسٍ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ مَنْ كَرِهَ مِنْ أَمِيرِهِ شَيْئًا فَلْيَصْبِرْ عَلَيْهِ فَإِنَّهُ لَيْسَ أَحَدٌ مِنَ النَّاسِ خَرَجَ مِنَ السُّلْطَانِ شِبْرًا فَمَاتَ عَلَيْهِ إِلاَّ مَاتَ مِيتَةً جَاهِلِيَّةً ‏"‏ ‏.‏
Reference : Sahih Muslim 1849b
In-book reference : Book 33, Hadith 88
USC-MSA web (English) reference : Book 20, Hadith 4560
  (deprecated numbering scheme)