|Part of a series on|
The Hanafi school (Arabic: حَنَفِية, romanized: Ḥanafiyah; also called Hanafite in English), Hanafism, or the Hanafi fiqh, is the oldest and one of the four traditional major Sunni schools (madhhab) of Islamic Law (Fiqh). It is named after the 8th century Kufan scholar, Abu Hanifa, a Tabi‘i of Persian origin whose legal views were preserved primarily by his two most important disciples, Imam Abu Yusuf and Muhammad al-Shaybani. It is considered one of the most widely accepted maddhab amongst Sunni Muslim community and is called the Madhhab of Jurists (maddhab ahl al-ray). Most of the later and modern day Ahnaf (Arabic: أحناف) , plural of Hanafi follows Maturidi theology.
The importance of this madhhab lies in the fact that it is not just a collection of rulings or sayings of Imam Abu Hanifa alone, but rather the rulings and sayings of the council of judges he established belong to it. It had a great excellence and advantage over the establishment of Sunni Islamic legal science. No one before Abu Hanifa preceded in such works. He was the first to solve the cases and organize them into chapters and was followed by Imam Malik ibn Anas in arranging Al-Muwatta. Since the Sahaba and the successors of the Sahaba did not put attention in establishing the science of Sharia or codifying it in chapters or organized books, but rather relied on the strength of their memorization for transmitting knowledge, Abu Hanifa feared that the next generation of the Muslim community would be misled, for not understanding the Islamic Sharia laws well. He began with Taharah (purification), then with Salat (prayer), then with other acts of Ibadah (worship), then Muwamalah (public treatment), then sealed the book with Mawarith (inheritance) which is what the jurists relied on him after his pass.
Under the patronage of the Abbasids, the Hanafi school flourished in Iraq and spread throughout the Islamic world, firmly establishing itself in Muslim Spain, Greater Khorasan and Transoxiana by the 9th-century, where it acquired the support of every rulers including Delhi Sultanate, Khwarazmian empire, Kazakh Sultanate and the local Samanid rulers. Turkic expansion introduced the school to the Indian subcontinent and Anatolia, and it was adopted as the chief legal school of the Ottoman and Mughal Empire. In the modern Republic of Turkey, the Hanafi jurisprudence is enshrined in Diyanet, the directorate for religious affairs, through the constitution (art. 136).
The Hanafi school is the maddhab with the largest number of adherents, followed by approximately one third of Sunni Muslims worldwide. It is mostly followed in Turkey, Egypt, Bosnia and other Balkans, the Levant, Central Asia, Morocco, Pakistan and Bangladesh, in addition to parts of Russia, China, and India. The other primary Sunni legal schools are the Maliki, Shafi`i and Hanbali schools.
The circumference of Islamic Sharia is very vast. However, there was no madhhab existed in the form current structure among the Sahaba. To them, the only sources of Sharia were the Quran and the Sunnah. If not found in these two sources, consensus used to be adopted. Furthermore, throughout history, the Companions have differed in their practice of knowledge, variation in expertising in certain religious matters, except for those on which there had consensus. The Companions did not live all in specific areas, but were engaged in establishing the Shari'ah in the conquered Muslim areas, and due to differences in knowledge, the Shari'ah took on different forms in those areas. At the end of the era of the Companions, the Tabi'is used to find solutions by adopting different ways to know and convey the Islamic Shari'ah. Therefore, it is said that the ingredients and formulas for establishing the Islamic Shari'ah were prepared by the Sahaba and the Tabi'is. At the end of the Tabi'i period, various wars and the expansion of the Islamic world felt the need to give the Shari'ah a scientific form—Fiqh—which Abu Hanifa, one of the last Tabi'in did by making a unique methodology after working 40 years. At the same time he also established the Islamic credology—Aqeeda as a individual religious science.
Ja'far al-Sadiq, a descendant of Muhammad was one of the teachers of Abu Hanifah and Malik ibn Anas who in turn was a teacher of Al-Shafi‘i,: 121 who in turn was a teacher of Ahmad ibn Hanbal. Thus all of the four great Imams of Sunni Fiqhs are connected to Ja'far directly and indirectly.
In the early history of Islam, Hanafi doctrine was not fully compiled. It was compiled in the 3rd Hijri century and has been gradually developing since then.
The Abbasid Caliphate and most of the Muslim dynasties were some of the earliest adopters of the relatively more flexible Hanafi fiqh and preferred it over the traditionalist Medina-based Fiqhs, which favored correlating all laws to Quran and Hadiths and disfavored Islamic law based on discretion of jurists. The Abbasids patronized the Hanafi school from the 2nd Hijri century onwards. The Seljuk Turkish dynasties of 5th and 6th Hijri centuries, followed by Ottomans and Mughals, adopted Hanafi Fiqh. The Turkic expansion spread Hanafi Fiqh through Central Asia and into Indian subcontinent, with the establishment of Seljuk Empire, Timurid dynasty, several Khanates, Delhi Sultanate, Bengal Sultanate and Mughal Empire. Throughout the reign of 77th Caliph and 10th Ottoman Sultan Suleiman the Magnificent and 6th Mughal emperor Aurangzeb Alamgir, the Hanafi-based Al-Qanun and Fatawa-e-Alamgiri served as the legal, juridical, political, and financial code of most of South Asia.
During the early periods of time that Islam was just being found up (mainly the first 250 years), there were around 100+ school of thoughts. 
The genesis stage of Hanafiet is generally reckoned by islamic scholars to begin with the time of the judicial research of Abu Hanifa (d. 150 AH) and end with the death of his senior disciple Hasan bin Ziyad (d. 204 AH).
This stage is concerned with the foundation of the Madhhab and its establishment, the formation of principles and bases upon which orders are determined and branches arises. Abu Zuhra, a prominent 20th century Egyptian Islamic jurist suggested, "The work would have done by the Imam himself. And under his guidance, his senior students would participated in it. Abu Hanifa had a unique "discussions and debate" method to conduct on the issues until they were settled. If resolved, Abu Yusuf would have been ordered to codify it."
Explaining the method of Abu Hanifa in teaching his companions, Al-Muwaffaq Al-Makki says, “Abu Hanifa established his doctrine by consultation among them. He never possess the rulings arbitrarily without them. He was diligent in practicing religion and exaggerated in advising about God, His Messenger and the believers. He would pick up questions one by one and present to them. He would heared what they had and say what he had. Debates would have continued with them for a month or more until one of the sayings was settled in it. Then Judge Abu Yusuf would formulate the principle from that, thus, he formulated all the principles.”  Accordingly, the students of Abu Hanifa were participants in the establishment of this jurisprudential structure, not they were just listeners, accepting what was presented to them. And Abu Yusuf was not the only one who recorded what the opinion settled on, but in the circle of Abu Hanifa there were ten blogging, headed by the four big ones: Abu Yusuf, Muhammad bin Al-Hassan Al-Shaibani, Zufar bin Al-Hudhayl, Hassan bin Ziyad al-Luluii.
Hanafi usul recognises the Quran, hadith, consensus (ijma), legal analogy (qiyas), juristic preference (istihsan) and normative customs (urf) as sources of the Sharia. Abu Hanifa is regarded by modern scholars as the first to formally adopt and institute qiyas as a method to derive Islamic law when the Quran and hadiths are silent or ambiguous in their guidance; and is noted for his general reliance on personal opinion (ra'y).
Nevertheless the usage of Ra'y as one of the sources of their jurisprudence, the Hanafite scholars still prioritize the textual approach of the Sahaba for their jurisprudence, as careful examination by modern Islamic jurisprudence researcher Ismail Poonawala, has found that the influence of the hadiths narrated by Zubayr regarding Rajm (stoning) execution as a form of punishment towards adulterers to be within Abu Hanifa's rulings in the Hanafite school of thought for such kinds of punishments' validity and furthermore, how to implement the punishment in accordance with Muhammad's teachings due to self-confession of the accused.[Notes 1] This Hanafite stoning law which is based on hadiths narrated by Zubayr arguably has historical and profound influence as various governments have implemented Hanafite code of law in their state laws from the late medieval to modern period:
The foundational texts of Hanafi madhab, credited to Abū Ḥanīfa and his students Abu Yusuf and Muhammad al-Shaybani, include Al-Fiqh al-Akbar (theological book on jurisprudence), Al-fiqh al-absat (general book on jurisprudence), Kitab al-Athar (thousands of hadiths with commentary), Kitab al-Kharaj and Kitab al-Siyar (doctrine of war against unbelievers, distribution of spoils of war among Muslims, apostasy and taxation of dhimmi).
The Hanafi school favours the use of istihsan, or juristic preference, a form of ra'y which enables jurists to opt for weaker positions if the results of qiyas lead to an undesirable outcome for the public interest (maslaha). Although istihsan did not initially require a scriptural basis, criticism from other schools prompted Hanafi jurists to restrict its usage to cases where it was textually supported from the 9th-century onwards.
Main article: List of Hanafis
((cite web)): CS1 maint: url-status (link)
((cite journal)): Cite journal requires
|journal=(help)CS1 maint: location (link)
((cite web)): CS1 maint: url-status (link)