This article has multiple issues. Please help talk page. (Learn how and when to remove these template messages)( or discuss these issues on the Learn how and when to remove this template message)
A Qadi (Arabic: ?, romanized: q; also Qazi, cadi, kadi or kazi) is the magistrate or judge of a Shari?a court, who also exercises extrajudicial functions, such as mediation, guardianship over orphans and minors, and supervision and auditing of public works.
The term "qadi" was in use from the time of Muhammad and remained the term used for judges throughout Islamic history and the period of the caliphates. While the muftis and fuqaha played the role in elucidation of the principles of jurisprudence and the laws, the qadi remained the key person ensuring the establishment of justice on the basis of these very laws and rules. Thus, the qadi was chosen from amongst those who had mastered the sciences of jurisprudence and law. In constructing their legal doctrine, these legal scholars took as their point of departure the precedents already established by the qadis.
During the period of the Abbasid Caliphate, the office of the qadi al-qudat (Chief Justice of the Highest Court) was established. Among the most famous of the early qadi al-qudat was Qadi Abu Yusuf who was a disciple of the famous early jurist Abu Hanifa.
The office of the qadi continued to be a very important one in every principality of the caliphates and sultanates of the Muslim empires over the centuries. The rulers appointed qadis in every region, town and village for judicial and administrative control and to establish peace and justice over the dominions they controlled.
The Abbasids created the office of chief qadi (qadi al-quh, sometimes romanized as Qadi al-Quda), 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 state, which ruled Egypt and Syria from 1250 to 1516 CE, introduced the practice of appointing four chief qadis, one for each of the Sunni legal schools (madhhabs).
Although the primary responsibility of a qadi was a judicial one, he was generally charged with certain nonjudicial responsibilities as well, such as the administration of religious endowments (waqfs), 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).
A qadi is a judge responsible for the application of Islamic positive law (fiqh). The office originated under the rule of the first Umayyad caliphs (AH 40-85/661-705 CE), when the provincial governors of the newly created Islamic empire, unable to adjudicate the many disputes that arose among Muslims living within their territories, began to delegate this function to others. In this early period of Islamic history, no body of Islamic positive law had yet come into existence, and the first qadis therefore decided cases on the basis of the only guidelines available to them: Arab customary law, the laws of the conquered territories, the general precepts of the Qurn, and their own sense of equity.
During the later Umayyad period (705-750 CE), a growing class of Muslim legal scholars, distinct from the qadis, busied themselves with the task of supplying the needed body of law, and by the time of the accession to power of the Abbasid dynasty in 750 their work could be said to have been essentially completed. In constructing their legal doctrine, these legal scholars took as their point of departure the precedents already established by the qadis, some of which they rejected as inconsistent with Islamic principles as these were coming to be understood, but most of which they adopted, with or without modification. Thus the first qadis in effect laid the foundations of Islamic positive law. Once this law had been formed, however, the role of the qadi underwent a profound change. No longer free to follow the guidelines mentioned above, a qadi was now expected to adhere solely to the new Islamic law, and this adherence has characterized the office ever since.
A qadi continued, however, to be a delegate of a higher authority, ultimately the caliph or, after the demise of the caliphate, the supreme ruler in a given territory. This delegate status implies the absence of a separation of powers; both judicial and executive powers were concentrated in the person of the supreme ruler (caliph or otherwise). On the other hand, a certain degree of autonomy was enjoyed by a qadi in that the law that he applied was not the creation of the supreme ruler or the expression of his will. What a qadi owed to the supreme ruler was solely the power to apply the law, for which sanctions were necessary that only the supreme ruler as head of the state could guarantee.
Similar to a qadi, a mufti is also an interpreting power of Shari'a law. Muftis are jurists that give authoritative legal opinions, or fatwas, and historically have been known to rank above qadis.  With the introduction of the secular court system in the 19th century, Ottoman councils began to enforce criminal legislation, in order to emphasize their position as part of the new executive. This creation of the hierarchical secular judiciary did not displace the original Shari'a courts.
Shari'a justice developed along lines comparable to what happened to the organization of secular justice: greater bureaucratization, more precise legal circumscription of jurisdiction, and the creation of a hierarchy. This development began in 1856.
Until the Qadi's Ordinance of 1856, the qadis were appointed by the Porte and were part of the Ottoman religious judiciary. This Ordinance recommends the consultation of muftis and 'ulama' . In practice, the sentences of qadis usually were checked by muftis appointed to the courts. Other important decisions were also checked by the mufti of the Majlis al-Ahkdm or by a council of 'ulama' connected with it. It is said that if the local qadi and mufti disagreed, it became customary to submit the case to the authoritative Grand Mufti.
Later, in 1880, the new Shari'a Courts Ordinance introduced the hierarchical judiciary. Through the Ministry of Justice, parties could appeal to the Cairo Shari'a Court against decisions of provincial qadis and ni'ibs. Here, parties could appeal to the Shari'a Court open to the Shaykh al-Azhar and the Grand Mufti, where other people could be added.
Lastly, judges were to consult the muftis appointed to their courts whenever a case was not totally clear to them. If the problem was not solved, the case had to be submitted to the Grand Mufti, whose fatwa was binding on the qadi. 
A qadi must be an adult. They must be free, a Muslim, sane, unconvicted of slander and educated in Islamic science. Their performance must be totally congruent with Sharia without using their own interpretation. In a trial in front of a qadi, it is the plaintiff who is responsible for bringing evidence against the defendant in order to have him or her convicted. There are no appeals to the judgements of a qadi. The qadi must exercise their office in a public place, the chief masjid is recommended, or, in their own house, where the public should have free access.
Qadis must not receive gifts from participants in trials and they must be careful in engaging themselves in trade. Despite the rules governing the office, Muslim history is full of complaints about qadis. It has often been a problem that qadis have been managers of waqfs, religious endowments.
The qualifications that a qadi must possess are stated in the law, although the law is not uniform on this subject. The minimal requirement upon which all the jurists agree is that a qadi possess the same qualifications as a witness in court, that is, that they be free, sane, adult, trustworthy, and a Muslim. Some require that they also possess the qualifications of a jurist, that is, that they be well versed in the law, while others regard those qualifications as simply preferable, implying that a person may effectively discharge the duties of the office without being well versed in the law. This latter position presupposed that a qadi who is not learned in matters of law would consult those who are before reaching a decision. Indeed, consultation was urged upon the learned qadi as well, since even the learned are fallible and can profit from the views of others. Those consulted did not, however, have a voice in the final decision making. The Islamic court was a strictly one-judge court and the final decision rested upon the shoulders of a single qadi.
The jurisdiction of a qadi was theoretically coextensive with the scope of the law that he applied. That law was fundamentally a law for Muslims, and the internal affairs of the non-Muslim, or dhimm?, communities living within the Islamic state were left under the jurisdictions of those communities. Islamic law governed dhimm?s only with respect to their relations to Muslims and to the Islamic state. In actual practice, however, the jurisdiction of a qadi was hemmed in by what must be regarded as rival jurisdictions, particularly that of the malim court and that of the shur?ah.
The malim was a court (presided over by the supreme ruler himself or his governor) that heard complaints addressed to it by virtually any offended party. Since Islamic law did not provide for any appellate jurisdiction but regarded the decision of a qadi as final and irrevocable, the malim court could function as a kind of court of appeals in cases where parties complained of unfair decisions from qadis. The malim judge was not bound to the rules of Islamic law (fiqh), nor for that matter was he bound to any body of positive law, but was free to make decisions entirely on the basis of considerations of equity. The malim court thus provided a remedy for the inability of a qadi to take equity freely into account. It also made up for certain shortcomings of Islamic law, for example, the lack of a highly developed law of torts, which was largely due to the preoccupation of the law with breaches of contracts. In addition, it heard complaints against state officials.
The shur?ah, on the other hand, was the state apparatus responsible for criminal justice. It too provided a remedy for a deficiency in the law, namely the incompleteness and procedural rigidity of its criminal code. Although in theory a qadi exercised a criminal jurisdiction, in practice this jurisdiction was removed from his sphere of competence and turned over entirely to the shur?ah, which developed its own penalties and procedures. What was left to the qadi was a jurisdiction concerned mainly with cases having to do with inheritance, personal status, property, and commercial transactions. Even within this jurisdiction, a particular qadi's jurisdiction could be further restricted to particular cases or types of cases at the behest of the appointing superior.
The principle of delegation of judicial powers not only allowed the supreme ruler to delegate these powers to a qadi; it also allowed qadis to further delegate them to others, and there was in principle no limit to this chain of delegation. All persons in the chain, except for the supreme ruler or his governor, bore the title qadi. Although in theory the appointment of a qadi could be effected by a simple verbal declaration on the part of the appointing superior, normally it was accomplished by means of a written certificate of investiture, which obviated the need for the appointee to appear in the presence of the superior. The appointment was essentially unilateral rather than contractual and did not require acceptance on the part of the appointee in order to be effective. It could be revoked at any time.
The Jews living in the Ottoman Empire sometimes used qadi courts to settle disputes. Under the Ottoman system, Jews throughout the Empire retained the formal right to oversee their own courts and apply their own religious law. The motivation for bringing Jewish cases to qadi courts varied. In sixteenth-century Jerusalem, Jews preserved their own courts and maintained relative autonomy. Rabbi Samuel De Medina and other prominent rabbis repeatedly warned co-religionists that it was forbidden to bring cases to government courts and that doing so undermined Jewish legal authority, which could be superseded only "in matters that pertained to taxation, commercial transactions, and contracts".
Throughout the century, Jewish litigants and witnesses participated in Muslim court proceedings when it was expedient, or when cited to do so. Jews who wanted to bring cases against Muslims had to do so in qadi courts, where they found a surprising objectivity. But the different legal status of Jews and Muslims was preserved. Jewish testimony was weighted differently when the testimony was prejudicial to Jews or Muslims.
In accordance with section 12 of the Muslim Marriage and Divorce Act, the Judicial Services Commission may appoint any male Muslim of good character and position and of suitable attainments to be a Quazi. The Quazi does not have a permanent courthouse, thus the word "Quazi Court" is not applicable in the current context. The Quazi can hear the cases anywhere and anytime he wants. Currently most Quazis are laymen.
In accordance with section 15 of the Muslim Marriage and Divorce Act, the Judicial Services Commission may appoint a Board of Quazis, consisting of five male Muslims resident in Sri Lanka, who are of good character and position and of suitable attainments, to hear appeals from the decisions of the Quazis under this Act. The Board of Quazis does not have a permanent courthouse either. Usually an appeal or a revision takes a minimum of two to three years in order to arrive for judgment from the Board of Quazis. The Board of Quazis can start the proceedings at whatever time they want and end the proceedings at whatever time they want. The Office of the Board of Quazis is situated in Hulftsdorp, Colombo 12.
Although the role of qadi has traditionally been restricted to men, women now serve as qadis in many countries, including Egypt, Jordan, Malaysia, Palestine, Tunisia, Sudan, and the United Arab Emirates. In 2009, two women were appointed as qadis by the Palestinian Authority in the West Bank. In 2010, Malaysia appointed two women as qadis as well. However, it was decided that as women they may only rule over custody, alimony, and common property issues, not over criminal or divorce cases, which usually make up most of a qadi's work. In Indonesia, there are nearly 100 female qadis. In 2017, Hana Khatib was appointed as the first female qadi in Israel.
There is disagreement among Islamic scholars as to whether women are qualified to act as qadis or not.
The rulers of Muslim IndoPak also used the same institution of the qadi (or qazi). The qadi was given the responsibility for total administrative, judicial and fiscal control over a territory or a town. He would maintain all the civil records as well. He would also retain a small army or force to ensure that his rulings are enforced.
In most cases, the qazi would pass on the title and position to his son, descendant or a very close relative. Over the centuries, this profession became a title within the families, and the power remained within one family in a region. Throughout Muslim Regions, we now find various Qazi families who descended through their famous Qazi (Qadi) ancestors and retained the lands and position. Each family is known by the town or city that their ancestors controlled. Qazis are mostly found in areas of Pakistan, specifically in Sindh. They are now also prominent in small areas of Australia.
On the island of Mayotte, one of the Comoro Islands, the title qadi was used for Umar who governed it from 19 November 1835 to 1836 after its conquest by and annexation to the Sultanate of Ndzuwani (Anjouan).
In the Songhai Empire, criminal justice was based mainly, if not entirely, on Islamic principles, especially during the rule of Askia Muhammad. The local qadis were responsible for maintaining order by following Sharia law according to the Qur'an. An additional qadi was noted as a necessity in order to settle minor disputes between immigrant merchants.Qadis worked at the local level and were positioned in important trading towns, such as Timbuktu and Djenné. The Qadi was appointed by the king and dealt with common-law misdemeanors according to Sharia law. The Qadi also had the power to grant a pardon or offer refuge.
Alcalde, one of the current Spanish terms for the mayor of a town or city, is derived from the Arabic al-qa?i ( ?), "the judge". In Al-Andalus a single qadi was appointed to each province. To deal with issues that fell outside of the purview of sharia or to handle municipal administration (such as oversight of the police and the markets) other judicial officers with different titles were appointed by the rulers.
The term was later adopted in Portugal, Leon and Castile during the eleventh and twelfth centuries to refer to the assistant judges, who served under the principal municipal judge, the iudex or juez. Unlike the appointed Andalusian qadis, the alcaldes were elected by an assembly of the municipality's property owners. Eventually the term came to be applied to a host of positions that combined administrative and judicial functions, such as the alcaldes mayores, the alcaldes del crimen and the alcaldes de barrio. The adoption of this term, like many other Arabic ones, reflects the fact that, at least in the early phases of the Reconquista, Muslim society in the Iberian Peninsula imparted great influence on the Christian one. As Spanish Christians took over an increasing part of the Peninsula, they adapted Muslim systems and terminology for their own use.
In the Ottoman Empire, qadis were appointed by the Veliyu l-Emr. With the reform movements, secular courts have replaced qadis, but they formerly held wide-ranging responsibilities:
The role of the Qadi in the Ottoman legal system changed as the Empire progressed through history. The 19th century brought a great deal of political and legal reform to the Ottoman Empire in an effort to modernize the nation in the face of a shifting power balance in Europe and the interventions in Ottoman territories that followed. In territories such as the Khedivate of Egypt, attempts were made at merging the existing Hanafi system with French-influenced secular laws in an attempt to reduce the influence of local Qadis and their rulings. Such efforts were met with mixed success as the Ottoman-drafted reforms often still left fields such as civil law open to a Qadi's rulings based on the previously used Hanafi systems in sharia-influenced courts. 
As the Empire expanded, so did the legal complexities that were built into the system of administration carried over and were enhanced by the conditions of frontier expansion. In particular, the Islamic empire adapted legal devices to deal with the existence of large populations of non-Muslims, a persistent feature of empire despite incentives for conversion and in part because of institutional protections for communal legal forums. These aspects of the Islamic legal order would have been quite familiar to travelers from other parts of the world. Indeed, Jewish, Armenian, and Christian traders found institutional continuity across Islamic and Western regions, negotiating for and adopting strategies to enhance this resemblance.