Umm Salamah (May Allah be pleased with her) reported:
The Prophet (ﷺ) said, "You will have rulers some of whom you approve and some of whom you will disapprove. He who dislikes them will be safe, and he who expresses disapproval will be safe, but he who is pleased and follows them (will be indeed sinful)". His audience asked: "Shall we not fight them?" He replied, "No, as long as they establish Salat amongst you".[Muslim].
Arabic/English book reference: Book 1, Hadith 188