Abu Hurairah reported,

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

Azami 7620

Sahih

عن أبي هريرة

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

الأعظمي 7620صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Leadership
Section
Obligation of obeying those in authority in matters that are not disobedience to Allah
Numbering
Jami al-Kamil 7620 (2nd edition)
Azami 7620