In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
Imaam Al-Barbahaaree [rahimahullaah] stated: “From the Sunnah is that you do not help anyone in disobedience to Allah, whether they be parents or any of the creation. There is no obedience to a human in disobedience to Allah and no one is to be loved for that; rather all of that is to be hated for [the sake of Allah], the Blessed and Most High”.
Regarding the statement of Imaam Al-Barbahaaree: ‘From the Sunnah is that you do not help anyone in disobedience to Allah’; Shaikh Saaleh Al-Fawzaan [hafidhahullaah] commented saying: This is a fundamental principle from the fundamental principles of Ahlus Sunnah Wal Jamaa’ah that has been derived from the statement of the [Prophet (sallal-laahu-alayhi-wasallam)] that, “There is no obedience to the creation in disobedience to the Creator”. And he [sallal-laahu-alayhi-wasallam] said, “Obedience is only in that which is good”.
So whoever commands disobedience to Allah is not to be obeyed. He is not to be obeyed in disobedience, whether your father, mother, or from the closest of the people to you, or a Ruler or a King. He is not to be followed in disobedience. Allaah [The Exalted] stated about the Yahood and Nasaaraa when they followed [their Rabis and Monks] in disobedience: [ٱتَّخَذُوٓاْ أَحۡبَارَهُمۡ وَرُهۡبَـٰنَهُمۡ أَرۡبَابً۬ا مِّن دُونِ ٱللَّهِ – They (Jews and Christians) took their rabbis and their monks to be their lords besides Allaah (by obeying them in things which they made lawful or unlawful according to their own desires without being ordered by Allaah)]. [Surah At-tawbah, Aayah 31]
And concerning the statement of Imaam Barbahaaree, ‘Whether they be parents or any of the creation’; Allaah [The Exalted] said about parents:
وَوَصَّيۡنَا ٱلۡإِنسَـٰنَ بِوَٲلِدَيۡهِ حَمَلَتۡهُ أُمُّهُ ۥ وَهۡنًا عَلَىٰ وَهۡنٍ۬ وَفِصَـٰلُهُ ۥ فِى عَامَيۡنِ أَنِ ٱشۡڪُرۡ لِى وَلِوَٲلِدَيۡكَ إِلَىَّ ٱلۡمَصِيرُ
وَإِن جَـٰهَدَاكَ عَلَىٰٓ أَن تُشۡرِكَ بِى مَا لَيۡسَ لَكَ بِهِۦ عِلۡمٌ۬ فَلَا تُطِعۡهُمَاۖ وَصَاحِبۡهُمَا فِى ٱلدُّنۡيَا مَعۡرُوفً۬اۖ وَٱتَّبِعۡ سَبِيلَ مَنۡ أَنَابَ إِلَىَّۚ َ
And We have enjoined on man (to be dutiful and good) to his parents. His mother bore him in weakness and hardship upon weakness and hardship, and his weaning is in two years give thanks to Me and to your parents, unto Me is the final destination. But if they (both) strive with you to make you join in worship with Me others that of which you have no knowledge, then obey them not, but behave with them in the world kindly, and follow the path of him who turns to Me in repentance'[31:14-15]
Allah [The Exalted] said: [وَوَصَّيۡنَا ٱلۡإِنسَـٰنَ بِوَٲلِدَيۡهِ حُسۡنً۬اۖ وَإِن جَـٰهَدَاكَ لِتُشۡرِكَ بِى مَا لَيۡسَ لَكَ بِهِۦ عِلۡمٌ۬ فَلَا تُطِعۡهُمَآۚ إِلَىَّ مَرۡجِعُكُمۡ فَأُنَبِّئُكُم بِمَا كُنتُمۡ تَعۡمَلُونَ – And We have enjoined on man to be good and dutiful to his parents, but if they strive to make you join with Me (in worship) anything (as a partner) of which you have no knowledge, then obey them not. Unto Me is your return, and I shall tell you what you used to do]. [Surah Al-Ankabut. Aayah 8] There is no obedience to the creation in disobedience to the Creator, regardless who that may be, even if he is the closest of the people to you, such as the two parents; then what about other than them!
[Source: An Excerpt from It-haaful Qaaree Bitta’liqaat Alaa Sharhis Sunnah Lil Imaam Barbahaaree. 2/297-299]