The Messenger of Allah, peace and blessings be upon him, said, “The best of your rulers are those whom you love and they love you, who pray for you and you pray for them. The worst of your rulers are those whom you hate and they hate you, whom you curse and they curse you.” It was said, “Shall we confront them with swords?” The Prophet said, “No, as long as they establish prayer among you. If you find something hateful from them, you should hate their actions but not withdraw your hand from obedience.” Source: Sahih Muslim