Sayyiduna Ka'b bin Ujrah (may Allah be pleased with him) said: the Messenger of Allah (peace and blessings be upon him) came to us and said: "Who is here? Are you listening? After me there will be rulers who act without obedience to Allah. Whoever joins them in their actions and helps them in their oppression, he is not from me and I am not from him. And whoever does not join them in their actions and does not help them in their oppression, he is from me and I am from him."
Hadith Referenceالمعجم الكبير للطبراني / باب الكاف / 16403