The Muslims cooperated in this, and his caliphs followed much the same course. They would appoint a judge to act as their deputy in their capital in matters on whose rulings they agreed. If a difficult case came before the judge, he would consult the caliph, just as Zayd would consult ʿUmar on questions concerning the grandfather’s inheritance, divorce, and other matters (1).
After the era of the caliphs, practices varied across periods and lands according to whether the need was slight or great; whether the senior ruler was capable or incapable; whether he actively attended to affairs or turned away from them; and for other reasons. Some of these responsibilities consequently came to be handled by the military governor, who was the chief of police.
The chief of police served as the executor of the senior ruler’s orders, the latter being known as “the sultan’s deputy.” Anas ibn Mālik said: “[Qays ibn] Saʿd occupied, in relation to the Prophet—peace and blessings be upon him—the same position as the chief of police in relation to a ruler” (2).
Some of these responsibilities were handled by the muhtasib, who was charged with enjoining right and forbidding wrong; his office could fall within the judge’s jurisdiction. Others were handled by the judge.
Any public office administered in obedience to Allah and His Messenger was legitimate under the Sharia. Any office administered contrary to that, or in which an obligatory duty was neglected, was not legitimate under the Sharia. Yet because the judge was more closely connected with learning and scholars (3) [and] more knowledgeable about the Sharia, many people came to believe that there was no public office in which the rulings of the Sharia were binding or applied=