The Hanafi school emerged from the legal tradition of
Kufa in
Iraq, in which its eponym
Abu Hanifa () resided. Iraqi jurists were known for their use of independent reasoning ('''') in deriving law. Kufa, alongside
Medina and
Basra, was a centre of legal activity at the beginning of the second Hijri century. Its prominent jurists included
Amir al-Sha'bi,
Ibrahim al-Nakha'i and
Hammad ibn Abi Sulayman. The opinions of Abu Hanifa and the earlier Kufan jurists closely correspond, particularly those of al-Nakha'i. Abu Hanifa's legal doctrine, as conveyed to his students, was predominantly derived from his own instructors, chiefly Hammad. Abu Hanifa attended Hammad's
study circle for approximately 20 years and inherited it upon Hammad's death.
Formative period in Baghdad, which houses the tomb of Abu Hanifa Abu Hanifa and his students were responsible for systemising the use of '''', of which Abu Hanifa was its "unrivalled master". According to his contemporary
Shu'ba ibn Ayyash, Abu Hanifa was the "most systematic jurist of his time". His legal thought was distinct for its treatment of hypothetical scenarios, which he held would help prepare for disastrous circumstances. It was also distinct for its method of analogical reasoning (''''). Abu Hanifa would identify the normative, underlying principles of the law from the Quran,
hadith and practices of
Muhammad's companions, and applied these to solve unprecedented legal cases. '
and adherence to analogical consistency were defining characteristics of early Hanafis, who employed juristic discretion () to depart from the results of ' when deemed appropriate. As '''' enabled the treatment of multiple legal cases from a single case, it facilitated the systematic compilation of legal literature. There is no record of legal treatises authored by Abu Hanifa. His teachings were transmitted by his disciples
Abu Yusuf () and
Muhammad al-Shaybani (), the last of whom was the most prolific. Later Hanafis termed the corpus of al-Shaybani as the "" and ascribed it an authoritative status. The students of Abu Hanifa established
study circles in
Baghdad, an emerging hub of cultural activity and the seat of the
Abbasid Caliphate. The school won the support of the centralising Abbasid state, which sought to unify the legal system. The Abbasids' preference for appointing Hanafi judges assisted in spreading the school. Abu Yusuf served as a
judge in Baghdad; the Abbasid caliph
Harun al-Rashid () later appointed him as the
chief judge. By the time of al-Shaybani's death, the school had spread to
Egypt and
Balkh in
Tokharistan. depicting Abu Hanifa ''
dialectics involved the interlocutors exploring a series of hypothetical legal cases to delineate the limits of legal assumptions. In practice, it led Hanafis to favour widely accepted hadith, particularly those which enshrined general principles that were applicable to other cases. When the widespread collection of hadith led to the circulation of reports that contradicted Hanafi positions, the Hanafis prioritised those that were acted upon by the Iraqi legal tradition. Reports supported by Iraqi juristic practice were deemed more authoritative than those which were not. Abu Yusuf and al-Shaybani separately authored works named Kitab al-Athar
(),'' which sought to ground Hanafi teachings in the precedent of the early Kufan jurists and the Kufan companions of
Muhammad, notably
Abd Allah ibn Mas'ud and
Ali. Abu Hanifa himself is known to have used hadith; in Abu Yusuf's
Ikhtilaf Abi Ḥanifa wa-Ibn Abi Layla, which lists cases where Abu Hanifa differed with his contemporary
Ibn Abi Layla, Abu Hanifa is quoted as citing a hadith in around 10% of the cases presented, but cites narrations attributed to Muhammad's companions more often. In contemporary external sources, members of the nascent school were described as the '
("companions of Abu Hanifa") and the ' ("companions of '
"). Early Hanafi doctrine was attacked by the traditionists, who accused Hanafis of preferring their ' to hadith. The traditionists primarily found objectionable the Hanafi practice of sometimes favouring '
over hadith that were not widely transmitted ('). The identification of Hanafis with the in contradistinction to the traditionist '''' strengthened during the resurgence of the latter following the
Mihna.
Al-Shafi'i (), too, critiqued the Hanafis' treatment of hadith and their claim that their positions reflected those of the Kufan companions of Muhammad. He further argued that '''' was subjective, which later led to classical Hanafi legal theorists articulating it as being completely dependent on the primary sources of law.
Classical period During the 9th century, the Hanafi school transitioned from a "personal school" centered around individual jurists and their study circles to a distinct legal community with a collectively recognised doctrine and authoritative figures. By the end of the century, the school resembled a professional body with a doctrine that was systematically transmitted from teachers to students, maturing into its classical form. Hanafis began to write commentaries on earlier works; until the 12th century, these were mostly on the works of al-Shaybani.
Al-Quduri ()'s legal primer was the classical school's first work of the genre and the most authoritative after that of al-Shaybani. Criticism from the traditionists led to the Hanafis grounding their positions in hadith over the 9th century. Some Hanafis moved towards using the traditionists' method of
hadith criticism to justify the school's positions, such as the Egyptian jurist
al-Tahawi (). Nonetheless, the classical legal theorists focused on formulating a Hanafi approach to hadith criticism that emphasised a hadith's acceptance by early jurists, with
transmitter analysis taking a secondary role. ()During the 9th century, the Hanafi school also emerged as the prevailing school in
Transoxiana and Tokharistan. The school was introduced to Transoxiana by the students of Abu Hanifa and al-Shaybani, but became prevalent under the
Samanids, during whose rule Hanafi scholars received official favour. The Transoxianan Hanafi tradition was highly influential in defining the doctrine of the later school. Works authored by Transoxianan jurists and accorded a high status in later Hanafi tradition include: • The jurisprudential work of
al-Sarakhsi (), known as , as well as his legal commentary . • The of
Burhan al-Din al-Marghinani (), which is considered the most authoritative representation of the early classical school. • , a large legal commentary by
Ala al-Din al-Kasani (). The intellectual descendants of al-Sarakhsi and his teacher, Abd al-Aziz ibn Ahmad al-Halwani (), eventually became the primary branch of the Transoxianan tradition. For 300 years after al-Sarakhsi, the Halwani-Sarakhsi branch constituted almost all of the major jurists engaged in rule-formulation ('''') within the school, and dominated the process. The process contributed to the stabilisation of the school's laws. The branch also popularised the doctrine of the '''': that the opinions transmitted from the school's founders command the highest level of authority within the school. In the 10th century, the Hanafi theologian
Abu Mansur al-Maturidi () developed a '''' tradition that crystallised into the
Maturidi school of theology, which had descended directly from the theological views of the earliest Hanafis. Due to philosophical differences, the Transoxianan Maturidis disagreed with the
Mu'tazilite strain of Iraqi Hanafis on several technical points of legal theory, but saw limited success in expunging the Mu'tazilite influence. The
Oghuz Turks who founded the
Seljuk Empire became attached to the Transoxianan Hanafi tradition. The Seljuks favoured these eastern Hanafis and appointed them to various official positions in their new territories, encouraging their migration out of Central Asia. During the Seljuk expansion of the 11th and 12th centuries, the Hanafi and Maturidi schools spread westward into Syria,
Anatolia and western Persia. In Syria and Iraq, the Central Asian scholars brought with them an increased emphasis on the ''''. Hanafi migration out of Central Asia accelerated during the
Mongol invasions, which ravaged the region.
Mamluk period During the 13th and 14th centuries, the
Mamluk Sultanate saw an influx of Hanafi scholars from Anatolia and Central Asia. Discussions of
Islamic logic and '''' in the Mamluk jurisprudential literature reflect the influence of Central Asian scholars. Criticism of the Hanafi approach to hadith prompted Mamluk Hanafi scholars to treat the subject in more detail. In his legal commentary '''', the Mamluk jurist
Ibn al-Humam () engages with the traditionists' approach to hadith criticism, and attempts to navigate the associated legal consequences. His approach to hadith influenced later Egyptian and Syrian Hanafi scholars. This "Egyptian school" of Hanafi hadith criticism referenced hadith from the
hadith collections instead of Hanafi legal works, and employed the traditionists' terminology to assess their authenticity. Mamluk jurists faced difficulties in interpreting the plurality of legal opinions that had accrued in the school. In his work '''', the Mamluk jurist () developed and detailed the process of rule-determination, clarifying the role of precedent and enabling other jurists to engage in the process themselves, and thus determine the applicable legal ruling for a given case. It marked a shift in the material consulted by muftis from the primary literature of the school to its secondary literature, comprising legal commentaries and compendia which contained rulings.
Ottoman era The
Ottoman Empire adopted the Hanafi school as their official legal school. The Ottomans established an extensive network of
madrasas to train jurists, with the most prestigious located in the capital
Constantinople. By the 16th century, the
Şeyḫülislâm emerged as the chief imperial religious and judicial authority. The
Şeyḫülislâm was appointed by the sultan and presided over the imperial canon, a collection of legal texts that the
imperial religious hierarchy was required to consult. Many jurists from Arab provinces of the empire were critical of the imperial canon, partly because of its inclusion of later works which they judged as contradicting the preferred opinions () of the school. The sultans influenced the formation of the imperial religious hierarchy by appointing
muftis directly and through the
Şeyḫülislâm, delineating the range of legal opinions in the Ottoman Hanafi tradition. Members of the imperial religious hierarchy were described as "". Intellectual genealogies () authored by the imperial religious hierarchy aimed to demarcate the institution, situate themselves and their endorsed works in the broader Hanafi tradition and construct an unbroken intellectual chain to Abu Hanifa. Hanafi law co-existed with the (dynastic law), decrees and edicts promulgated by the
sultans. The often reaffirmed religious laws; in other cases, it authorised actions that the jurists opposed, such as torture. The
Şeyḫülislâm would sometimes request sultanic edicts to require the imperial religious hierarchy to enforce particular rulings of the school. The
Maʿrūḍāt of the
Şeyḫülislâm Ebussuud Efendi (), a collection of
fatwas endorsed by
Suleiman I, contained sultanic edicts and was frequently referenced in later Hanafi works which considered its opinions binding. Late Hanafis believed that judges could act as deputies of the sultan who could thus regulate,
inter alia, the legal opinions judges could reference, such as in the case of inter-school disputes. In the 17th and 18th centuries, Hanafi jurists began to incorporate sultanic edicts into authoritative legal works. edition of the
Ibrahim al-Halabi ()'s legal manual was among the most popular in the empire and was the subject of over 70 commentaries. By the 19th century, it had become the standard legal textbook. Other popular Ottoman manuals were the of
Molla Hüsrev () and
al-Durr al-Mukhtar of Haskafi. The of the late Arab Ottoman jurist
Ibn Abidin () is considered an authoritative and representative work of the late Hanafi tradition. It lists most opinions within the school and their level of authoritativeness, incorporating most primary Hanafi sources produced until its writing. It employs legal devices such as necessity ('''') to depart from the canonical where necessary to ensure the continued relevancy of the school, and references sultanic edicts to revise the school's opinions. Between 1869 and 1877, the Ottomans promulgated the , a
codification of Hanafi jurisprudence. The was drafted by a committee led by the jurist
Ahmed Cevdet Pasha, who had successfully argued against the implementation of the
Napoleonic Code. It drew from the Hanafi literature on legal maxims () and to a great degree favoured the opinions of the late Hanafi tradition. Many of its articles were fully or partially derived from al-Halabi's . However, the also marked the state's assumption of control over jurisprudence, which had previously been the purview of the decentralized juristic community.
Indian subcontinent ' manuscript of the '''' The Hanafi school spread to India from Transoxiana and eastern Persia. To consolidate control over his realm, the
Mughal emperor
Awrangzib () ordered the compilation of Hanafi . Completed between 1664 and 1672, the resulting selected legal opinions from earlier Hanafi legal works and is modelled after the of al-Marghinani. During the
colonization of India, the
East India Company sought to create a "complete digest of Hindu and Mussulman law" to eliminate legal pluralism. The resulting
Anglo-Muhammadan law was based in part on a translation of al-Marghinani's , which was chosen for its brevity and its belonging to the Hanafi school, which most Indian Muslims followed. Consequently, the was effectively codified and severed from the Hanafi commentarial tradition under which it was traditionally interpreted. In the 19th century, the
Barelvi and
Deobandi movements emerged in India. Their
legal views included strict adherence () to a legal school in contradistinction to the
Ahl-i Hadith movement, and emphasised the importance of hadith. The Deobandi acceptance of Ibn al-Humam's approach to hadith criticism culminated in the of Deobandi scholar
Zafar Ahmad Usmani (), a work that attempts to justify Hanafi positions using hadith. == Demographics ==