In his book The Mercy in the Difference of the Four Sunni Schools of Islamic Law, Qāḍī Ṣafadī* writes:
The Imams [Abū Ḥanīfah, Al-Shāfi‘ī, Mālik and Aḥmad bin Ḥanbal] agree that having a ruler [caliph] is an obligation and that the Muslims must have a ruler to establish the practices of the dīn and to give justice to the wronged from those who have wronged them, and that it is not permitted for there to be two rulers over the Muslims at the same time in the world, whether or not they are separate from each other or in agreement…The ruler must be obeyed in respect of all that he commands as long as that does not entail disobedience to Allah, and fighting under him is an obligation, and the judgements of those he appoints must be carried out.[Al-Qāḍī al-Ṣafadī, The Mercy in the Difference of the Four Sunni Schools of Islamic Law, Dar Al Taqwa, London, 2004, pp. 186-187 (translated by Aisha Bewley)]
*Muḥammad ibn ‘Abd al-Raḥmān ibn al-Ḥusayn al-Ṣafadī al-Shāfi‘ī was a famous qāḍī (judge) of Damascus who wrote several books. He died in 784/1378.
The book cited above is a well-known and widely used classical Arabic text. Qādī Ṣafadī wrote the work for his contemporaries as a reference book to acquaint the followers of the four Sunni schools of fiqh with the rulings of the other schools, so that needless misunderstandings would not arise from any differences.