A qāḍī (; otherwise transliterated as qazi, cadi, kadi, or kazi) is the magistrate or judge of a sharīʿa court, who also exercises extrajudicial functions such as mediation, guardianship over orphans and minors, and supervision and auditing of public works. History The term qāḍī was in use from the time of Muhammad during the early history of Islam, and remained the term used for judges throughout Islamic history and the period of the caliphates. While the muftī and fuqaha played the role in elucidation of the principles of Islamic jurisprudence (Uṣūl al-Fiqh) and the Islamic law (sharīʿa), the qāḍī remained the key person ensuring the establishment of justice on the basis of these very laws and rules. Thus, the qāḍī was chosen from amongst those who had mastered the sciences of jurisprudence and law. The Abbasid caliphs created the office of "chief qāḍī" (qāḍī al-quḍāh), whose holder acted primarily as adviser to the caliph in the appointment and dismissal of qadis. Later Islamic states generally retained this office, while granting to its holder the authority to issue appointments and dismissals in his own name. The Mamluk Sultanate, which ruled Egypt and Syria from 1250 to 1516 CE, introduced the practice of appointing four "chief qāḍī", one for each of the Sunnī schools of Islamic jurisprudence (madhhab). During the period of the Abbasid Caliphate, the office of "chief qāḍī" (qāḍī al-quḍāh) was established. Among the most famous of the early judges appointed to the role of qāḍī al-quḍāh was Abū Yūsuf, a disciple of the early Muslim scholar and jurist Abū Ḥanīfa al-Nuʿmān, founder of the Ḥanafī school of Islamic jurisprudence. The office of qāḍī continued to be a very important one in every principality of the caliphates and sultanates of the various Muslim empires over the centuries. The rulers appointed a qāḍī in every region, town, and village for judicial and administrative control, and in order to establish peace and justice over the dominions they controlled. Although the primary responsibility of a qāḍī was a judicial one, he was generally charged with certain nonjudicial responsibilities as well, such as the administration of religious endowments (wāqf), the legitimization of the accession or deposition of a ruler, the execution of wills, the accreditation of witnesses, guardianship over orphans and others in need of protection, and supervision of the enforcement of public morals (ḥisbah). Functions A qadi is a judge responsible for the