Abu Hurairah reported,

The Prophet ﷺ said, "Whoever obeys me has obeyed Allah, and whoever disobeys me has disobeyed Allah. Whoever obeys the commander has obeyed me, and whoever disobeys the commander has disobeyed me."

Muslim 4747

Sahih

حدثنا يحيى بن يحيى أخبرنا المغيرة بن عبد الرحمن الحزامي عن أبي الزناد عن الأعرج

عن أبي هريرة

عن النبي ﷺ قال من أطاعني فقد أطاع الله ومن يعصني فقد عصى الله ومن يطع الأمير فقد أطاعني ومن يعص الأمير فقد عصاني

مسلم 4747صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Leadership
Chapter
Obligation of obeying leaders in matters other than disobedience and its prohibition in disobedience
Numbering
Darussalam 4747
Muslim 4747