Ibn Taymiyyah, may Allah have mercy on him, said, “It is said that Allah allows the just state to remain even if it is led by unbelievers, but Allah will not allow the oppressive state to remain even if it is led by Muslims. And it is said that the world will endure with justice and unbelief, but it will not endure with oppression and Islam.”
Source: al-Amr bil Ma’rūf 1/29
قال ابن تيمية رحمه الله قيل إنَّ اللَّهَ يُقِيمُ الدَّوْلَةَ الْعَادِلَةَ وَإِنْ كَانَتْ كَافِرَةً وَلَا يُقِيمُ الظَّالِمَةَ وَإِنْ كَانَتْ مُسْلِمَةً ويقال الدُّنْيَا تَدُومُ مَعَ الْعَدْلِ وَالْكُفْرِ وَلَا تَدُومُ مَعَ الظُّلْمِ وَالْإِسْلَامِ
1/29 الأمر بالمعروف والنهي عن المنكر لابن تيمية