It is narrated from Sayyiduna Abu Umamah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Do not revile your imams (rulers); rather, pray for their righteousness, for their righteousness and soundness is a cause of good and righteousness for you as well."
Hadith Referenceالمعجم الأوسط / باب الألف / 1606
Hadith Takhrij«أخرجه الطبراني فى «الكبير» برقم: 7609»