Another misconception is that Islam, outside of the Shia school of thought, crystallized directly into four schools of thought, whereas in reality, the process was more complicated than this. However, through a combination of factors, not the least of which was government supported, these schools coalesced and took on separate identities during the time of the Abbasid Empire (75 AH – 1258).
Hanafi School (Al-Madhab al-Hanafi)
The Hanafi school, founded by Imam Abu Hanifah al-Nu’man b. Thabit (80 – 148 AH), was the first to acquire widespread popularity.
The first scholar to pay allegiance to this school of thought was Abul Abbas al-Saffah who was the leader of the revolution against the Umayyah dynasty and the founder of the Abbasid Empire. Other scholars and jurists (fuqaha) also joined him in the hope that a just government would rise and implement the sunnah of the Prophet and save the Muslim ummah from the tyranny of the Umayyah dynasty. However, Abu Hanifah soon realized that the Abbasid were not sincere in their call to establish the Islamic sharia (law) and Islamic government, and so he distanced himself from the government and refused to accept the formidable position of leadership in the judiciary system (al-qada) during the time of al-Mansur al-Abbasi.
Al-Mansur tried to bring Abu Hanifah to his side, but he refused and was then imprisoned, and according to some accounts even tortured. Some historians have also reported that the Abbasid eventually poisoned Abu Hanifah.
Nonetheless, the Abbasid government succeeded in attracting two of the most prominent students who had studied directly under Abu Hanifah: Abu Yusuf al-Qadi and Muhammad b. al-Hasan al-Shaybani. Abu Yusuf joined the Abbasid government during the reign of al-Mahdi al-Abbasi in the year 158 AH. He continued working for them during the rules of al-Hadi and al-Rashid and wrote several works on jurisprudence, one of the most noteworthy being Kitab al-Kharaj, which he wrote at the request of the caliph Harun al-Rashid.
He enjoyed an intimate relationship with the ruling powers, and through this, they supplemented the salary they paid him with gifts and lavish invitations, enabling him to lead an extravagant life for that time.
The other student, Muhammad b. al-Hasan al-Shaybani, assumed leadership of the judiciary system (al-qada) during the time of Harun al-Rashid. He wrote many thesis in jurisprudence (fiqh), including Jami al-Sagheer, which he narrated from Abu Yusuf al-Qadi, Abu Hanifah, and Jami al-Kabeer.
Undoubtedly, the government played a central role in promoting the Hanafi school of thought because of Abu Yusuf al-Qadi and Muhammad b. al-Hasan al-Shaybani, and particularly since the position of judiciary leadership that the latter took, was central in promoting the jurisprudence (fiqh) of a particular school of thought. Regarding this issue, Ibn Hazm says:
Two schools of thought were promoted and spread in the beginning of their emergence by leadership (riyasah) and the government (sultanah). The first was the Hanafi school of thought; since Abu Yusuf al-Qadi was declared the leader of the high court, he employed people only from his school of thought. The second school of thought that was supported by the government was the Maliki school of thought.
Along the same line, al-Dahlawi says:
Any school of thought whose leaders are famous and who assumed the positions of judiciary leadership (qada) and authority (ifta or the fatwa) will spread among the lands and expand day after day. Conversely, the people will not know any school of thought whose leaders did not assume the position of judiciary leadership and authority, and they will die out in the future.
From this, it is clear that the expansion of a school of thought at that time, hinged on the government. The government in turn, supported the schools of thought because of their willingness to compromise Islamic principles in favor of the government, and so a reciprocal relationship developed between the government and the propagators of the schools of thought who used the judiciary positions (the position of qadi) that they were appointed to, to spread their ideologies to the masses.
Maliki School of Thought (Al-Madhab al-Maliki)
Once Al-Mansur al-Abbasi failed to sway Abu Hanifah to his side, he turned his attention towards Imam Malik b. Anas (93 – 179 AH) and proposed that the body of Islamic knowledge unify under one definitive book and set of guidelines, rather than be split among several schools of thought, as was the case at that time. He encouraged Imam Malik to write al-Muwatta (the book that Imam Malik is well-known for). History says:
Al-Mansur spoke to al-Malik around 150 AH and encouraged him to write Fiqh al-Muwatta. He told him, “Put down this knowledge in writing, and try to avoid the eccentricity (shawad) of Ibn Abdullah al-Masud, the leniency (rukhsah) of Ibn Abbas, and the harshness (shadaid) of Ibn Umar. Be moderate in this fiqh and write whatever the majority of the imams and sahabah agree upon, and we promise you that we will bring all the people to follow your school of thought, and your fiqh and your knowledge, and we will spread and promote your book in the provinces and states, and we will ask the people not to oppose it, and they will not give judgments other than those in accordance with your books.”
Imam Malik spent approximately 11 years writing al-Muwatta, and his book eventually became the definitive legal text of the Abbasid state. The Abbasid rulers in turn, exhibited the utmost respect towards Imam Malik to the extent that Harun al-Rashid would stand whenever he saw Imam Malik, and then sit on the floor in front of him to listen to what he had to say. Through his open support of al-Mansur, Imam Malik alienated his teacher Rabiat al-Rai who refused to compromise his principles for the government and then parted company with Imam Malik.
Imam Malik continued to support the Abbasid government beyond the reign of al-Mansur into the time of al-Mahdi al-Abbasi. Just like al-Mansur, al-Mahdi al-Abbasi succeeded not in winning over the support of the Hanafi school of thought, but to entice two of Abu Hanifah’s most famous students (as mentioned above).
At the same time, as they fostered the growth of the Maliki movement, the Abbasid also attempted to suppress the school of Ahlul Bayt. Not only were the ideas of Ahlul Bayt school threatening, but its leaders were also popular, such as Imam Ja’far al-Sadiq. The sixth Imam of the Shia school of thought, who had nearly 4,000 students attending his classes.
Like the other Imams from Ahlul Bayt, Imam al-Sadiq was put under house arrest and later imprisoned. Only after methods of intimidation and coercion to halt the spread of his teachings failed, did the Abbasid attempt to counter his ideas by creating another intellectual entity to compete with him, in this case, the promotion of the Hanafi and Maliki schools of thought.
As it is said, people tend to follow the religion of their leaders; therefore, the ideological path that the Abbasid government was laying out was rudimentary for the people to follow. Still, like the rest of the imams of Ahlul Bayt, Imam al-Sadiq gave up his life at the hands of the ruling power for his unwavering resistance to compromise the principles of Islam.
Shafi’i School of Thought (Al-Madhab al-Shafi’i)
From the time of his childhood, Imam Muhammad b. Idris al-Shafi’i (150 – 206 AH) immersed himself in the ideas of Imam Malik. He was inspired deeply by him and nearly memorized al-Muwatta. Eventually he procured a letter of recommendation from the governor of Mecca to the governor of Madinah enabling him to meet with Imam Malik, whose status was very high in Madinah during the Abbasid time. There he became a student of Imam Malik until the death of Imam Malik about nine years later.
At that time, Imam Shafi’i fell into poverty and was obliged to return to Mecca. There, some individuals concerned about his condition, appealed to the governor of Yemen to find him an official position, and thus Imam al-Shafi’i was made the governor of the state of Najran in Yemen.
However, during the rule of Harun al-Rashid, Imam al-Shafi’i was accused of leaning towards the Alawiyin and the school of Ahlul Bayt, and so he was brought to Baghdad, handcuffed. While he was being held as a prisoner, one of his friends, Muhammad b. al-Hasan al-Shaybani (who was also one of the primary advocates of the Hanafi school of thought for the Abbasid) interceded on his behalf and testified that al-Shafi’i was not on the side of Ahlul Bayt and was completely supportive of the Abbasid government. This testimony resulted in the release of al-Shafi’i, and as a result, he became very close to al-Shaybani and studied under him, learning the opinions (araa) of Abu Hanifah in ra’i (opinion) and qiyas (analogy), both of which Abu Hanifah was well known for. However, the two differed regarding Ahlul Bayt – al-Shafi’i was in fact sympathetic towards their cause, while al-Shaybani was not.
Out of these two influences: the Maliki school (which can also be referred to as the school of athar (text)) and the Hanafi school, was born the Shafi’i school of thought. In 199 AH, Imam al-Shafi’i moved to Egypt along with Ibn Abdullah al-Abbas, the governor of Egypt. There, his school slowly began to spread. Unfortunately, because he differed on some points with Imam Malik, Imam al-Shafi’i incurred the anger of many of the adherents of the Maliki school in Egypt, and they eventually rioted and killed him.
It is worth noting that al-Bukhari and al-Muslim did not narrate any hadith from al-Shafi’i – not because he was inferior in knowledge, but because he had inclinations towards the school of Ahlul Bayt. He said that Ali b. Ali Talib had the right to leadership at the time over Mu’awiyah and his companions, who were the group that began the assault on Islam. He displayed love for Ahlul Bayt and the family of the Prophet and proclaimed, “If anyone who loves the Ahlul Bayt is a rafidi (a rejecter of the three caliphates) then let the whole world witness that I am the first rafidi.” Such statements not only led to his arrest as mentioned before, but also resulted in silencing his books of hadith.
Hanbali School of Thought (Al-Madhab al-Hanbali)
Imam Ahmad b. Hanbal (165 – 240 AH) was born in Baghdad. At the age of fifteen, he embarked on journeys to different countries to meet with various scholars. While in Baghdad, he studied under Imam al-Shafi’i, who inspired him considerably, and Abu Yusuf al-Qadi. At the time, there were two competing schools: madrasah al-athar (the school focusing on texts) and madrasah al-ra’i wal-qiyas (the school based on opinion and analogy), and Ibn Hanbal favored the former.
Although like other scholars, he too relocated to Hijaz, however he was not as well known as the leaders of the other schools of thought because most considered him to be a muhaddith (narrator of hadith) instead of a genuine faqih (jurist).
Ibn Hanbal was a strong advocate of the Abbasid government and when al-Mutawakil came to power in 232 AH, he tortured the Alawiyin and fiercely opposed the school of Ahlul Bayt, but he paid Ibn Hanbal a handsome salary of 4,000 dirhams, and invited him to Samarra to obtain blessings from his presence.
Ahmad b. al-Hanbal wrote his famous work Musnad Ahmad b. Hanbal under the reign of al-Mutawakil and passed away while al-Mutawakil was still in power. His case was similar to that of Imam al-Malik, whose ideas were also propagated by the Abbasid caliphate, and the Abbasid promoted both of their schools of thought.
 Al-Zarakli, Al-Alam, 6:80
 Wafayat al-Ayan, 6:144
 Al-Dahlawi, Hujjat Allah al-Balighah, 1:151
 Al-Imamah wal-Siyasah, 2:150
 Al-Nas ala Deen Mulukihim
 Mujam al-Udaba, 17:287
 The descendants of the Holy Prophet through Imam Ali.
 Tarikh Baghdad, 2:178
 Ali b. Abi Talib huwa al-Imam al-Haq.
 Al-Bidayah wal-Nihayah, 10:350