Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Whoever obeys me has obeyed Allah, and whoever disobeys me has disobeyed Allah. Whoever obeys my appointed leader has obeyed me, and whoever disobeys my appointed leader has disobeyed me."

Azami 12890

Sahih

عن أبي هريرة

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

الأعظمي 12890صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Nur
Section
His saying, "Say, obey Allah and obey the Messenger. But if you turn away, then upon him is only what he has been charged with, and upon you is what you have been charged with. And if you obey him, you will be guided. And there is not upon the Messenger except clear notification"
Numbering
Jami al-Kamil 12890 (2nd edition)
Azami 12890