Alqamah bin Wa'il (may Allah have mercy on him) narrates from his father, Sayyiduna Wa'il bin Hujr (may Allah be pleased with him), that he said to the Prophet (peace and blessings be upon him): "If a ruler is (appointed) over us who does deeds that are not in obedience to Allah (deeds of disobedience), should we listen to him and obey?" He (peace and blessings be upon him) turned away from him. He repeated the same question, and he (peace and blessings be upon him) turned away again. Then he (peace and blessings be upon him) said: "Upon them is the burden of what was laid upon them, and upon you is the burden of what was laid upon you."
Imam al-Tabarani (may Allah have mercy on him) said: "No one narrated this hadith from Muhammad bin Abi Isra'il except Hammam, and (from him) only Abdullah bin Raja' and Abu Abd al-Rahman al-Muqri' narrated it."
Hadith Referenceالمعجم الأوسط / باب الميم / 6707
Hadith Takhrij«أخرجه مسلم فى «صحيحه» برقم: 1846، والترمذي فى «جامعه» برقم: 2199، والبيهقي فى «السنن الكبرى» برقم: 16721، 16722، والبزار فى «مسنده» برقم: 4472، وابن أبي شيبة فى «مصنفه» برقم: 38417، والطبراني فى «الكبير» برقم: 20، 21»