Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) said: "Whoever obeys me has obeyed Allah, and whoever disobeys me has disobeyed Allah; whoever obeys my commander has obeyed me, and whoever disobeys my commander has disobeyed me."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قتال أهل البغي / 16603