Was custom a valid source of law for Muslim jurists? The straightforward, formal answer is no, as customary practice is not one of the classical four sources. But the historically-grounded answer, based on recent extensive scholarship, is that the Islamic legal tradition developed several mechanisms to grant approval to customary practices, even those that appeared to go against general principles of the sharīʿa.
These mechanisms changed over time. In the formative period, before the crystallization of al-Shāfiʿī’s legal theory, legal practices were integrated into the sharīʿa without much objection, and were not even labelled as customary. Gideon Libson argued that in this early period, customary practices were sacralised through the forging of hadīth and the invocation of ijmāʿ. Ahmed Fekry Ibrahim qualifies this by suggesting that Mālik and Abū Ḥanīfa developed specific legal methodologies (ʿamal and istiḥsān) that incorporated custom into the fabric of the law. Either way, customary practices of Muslim communities in the first Islamic centuries were integrated into Islamic law, even if they were not identified as such by contemporary jurists.
Once al-Shāfiʿī’s legal theory won the day, legal practices that emerged beyond the reach of the jurists were often given retroactive approval, accepted mainly through the principles of “need” (ḥāja) or “necessity” (ḍarūra). By the sixteenth century, examples of customary practices validated through these principles of need or necessity included interest-bearing loans to the poor, artisans remunerated by a share of their produce, and the sale of public offices.
Most commonly, necessity validated widespread share-cropping contracts. In the twelfth century, the Ḥanafī Qāḍīkhān permitted muzāraʿa contracts as a form of rent, based on social practice in his region. Medieval Mālikī jurists of North Africa accepted khimāsa contracts in which the peasant received a fifth of the harvest in return for his labor, despite the inevitable element of risk. Ibn Taymiyya did the same for share-cropping contracts which were common in the hinterland of Damascus in the early fourteenth century. In the Dakhla Oasis of the eighteenth century, contracts for the share-cropping of palm trees, formally invalid according to Shāfiʿī law, were rendered legitimate by invoking the ʿurf, or practice, of the people of the region.
And yet, the question remains: who permitted share-cropping contracts in the first place? Guided by our texts, written by medieval jurists, we tend to take their perspective and look from the inside out. We rarely ask what were the social and political forces leading to the spread of share-cropping, and who sanctioned these contracts prior to them coming before the jurists.
The answer is almost certainly the political elites. Share-cropping contracts were essential to the extraction of revenue from the countryside, and this agrarian revenue was the mainstay of the military and religious urban elites, who were its main beneficiaries. This has been a key argument of Johansen’s The Islamic Law of Land-Tax and Rent, as he demonstrates that Ḥanafī jurists adapted the law to fit the political economy of their time, as dictated by late medieval states.
Thus, the customary practice of share-cropping validated by late medieval jurists was very much a reflection of the interests of the group of which they were members. This “custom” didn’t come out of thin air and of some organic, natural development of these societies. In fact, medieval jurists tell us as much: al-Āmidī (d. 1233), cited by Ahmed Fekry Ibrahim, states that the only custom (here, ʿāda) that matters is the custom of the ahl al-ḥall wa’l-ʿaqd, the political authorities. The custom of the laity, on the other hand, has no legal consequences.
I believe that the “custom” that medieval jurists endorsed could be a short-hand for the legal practices promulgated by medieval states and their institutions. Far from being independent of political control, “custom” could often mean medieval jurists’ accommodation of the rules laid down by the state. After all, respecting customary law is ultimately the same as respecting the sanctions of the social order.
The ʿurfī royal courts in the Safavid Empire illustrate well the association between “custom” and the state. The ʿurfīcourts functioned much like the siyāsa courts in the Mamlūk period, offering effective, swift and sometimes arbitrary justice, while at the same time filled with sharīʿa experts and interacting with Islamic law on points of substance and procedure. Their “customary” status didn’t reflect some bottom-up community mores, but rather a form of royal justice.
The same goes for the Ottomans, who, since the fifteenth century, often referred to their Kanun as their ʿadet. In the nineteenth century, the culmination of this identification of custom with state legislation comes with Ibn ʿĀbidīn’s much-debated treatise on the place of custom in Islamic law. Ibn ʿĀbidīn may well have been elevating custom to the rank of a principal source of law. But for Ibn ‘Ābidin, as Martha Mundy argues in a recent contribution, ʿurf subsumes not only popular and commercial practice but also the practice of government.
For medieval and early modern jurists, “custom” was the prevalent social and political order, the will of those in power, an exigency that had to be accommodated. This was not the same as customary laws in the sociological sense. The ʿurfī courts of Safavid Iran, as well as the share-cropping contracts that allowed for the extraction of agricultural surplus, had literally nothing in common with the unwritten, long-established rules governing tribes or other socially distinct groups. Whether tribal customary laws actually existed in medieval Islamic societies is a question I will take up in the next two posts.
 Ayman Shabana, “Custom in the Islamic Legal Tradition,” in The Oxford Handbook of Islamic Law, eds. Anver M. Emon and Rumee Ahmed (Oxford: Oxford University Press, 2018), 231-49.
 Gideon Libson, “On the Development of Custom as a Source of Law in Islamic Law,” Islamic Law and Society 4, no. 2 (1997): 131-55. www.jstor.org/stable/3399492.
 Ḥanafī istiḥsān allowed analogy to follow existing practice, while the normative judicial and social ʿamal of the Muslim community in Medina shaped Mālik’s legal views. Ahmed Fekry Ibrahim, “Customary Practices as Exigencies in Islamic Law: Between a Source of Law and a Legal Maxim,” Oriens 46, no. 1–2 (January 1, 2018): 230, https://doi.org/10.1163/18778372-04601007.
 Ibrahim traces this development to a legal principle established by al-Juwaynī, which has been interpreted to mean that a “social need” (ḥāja) based on widespread practice could trump some of the textual sources. Ibrahim, “Customary Practices,” 244.
 Baber Johansen, “Coutumes locales et coutumes universelles: aux sources des règles juridiques en droit musulman hanéfite,” Annales Islamologiques 27 (1993) : 29–35. See also Christian Müller, “Us, coutumes et droit coutumier dans le fiqh malikite,” in La légitimation du pouvoir au Maghreb médiéval: de l’orientalisation à l’émancipation politique, eds. Annliese Nef and Élise Voguet (Madrid : Casa de Velázquez, 2011) : 35-54.
 Johansen, “Coutumes locales.”.
 Müller, “Us, coutumes et droit coutumier dans le fiqh malikite,” 38.
 Yossef Rapoport, “Ibn Taymiyya’s radical legal thought: Rationalism, pluralism and the primacy of intention”, in Ibn Taymiyya and His Times, Proceedings of a conference held at Princeton University, 8-10 April 2005, eds. Yossef Rapoport and Shahab Ahmad (Karachi: Oxford University Press, 2010), 191-226.
 Rudolph Peters, “Sharecropping in the Dakhla oasis: Shariʿa and customary law in Ottoman Egypt,” in The law applied: contextualising the Islamic Shariʿa: A volume in honor of Frank E.Vogel, eds. Peri Bearman, Wolfhart Heinrichs and Bernard G. Weiss (Tauris: London & New York, 2008), 79-91.
 Baber Johansen, The Islamic Law on Land Tax and Rent: The Peasants’ Loss of Property Rights as Interpreted in the Hanafite Legal Literature of the Mamluk and Ottoman Periods (London: Routledge, 2017).
 ʿAlī ibn Abī ʿAlī al-Āmidī, al-Ihḳām fī usụ̄l al-ahḳām, ed. ʿAbd al-Razzāq al-ʿAfīfī (Beirut: al-Maktab al-Islāmī, 2003), 4:159. See, in the context of whether ʿāda is a valid reason for istiḥsān, as discussed by Ibrahim, “Customary Practices,” 247.
 Müller, “Us, coutumes et droit coutumier dans le fiqh malikite,” 36.
 Rula Jurdi Abisaab, “Delivering Justice. The Monarch’s ʿurfī Courts and the Shariʿa in Safavid Iran,” in The Oxford Handbook of Islamic Law, eds. Anver M. Emon and Rumee Ahmed (Oxford: Oxford University Press, 2018), 511-36.
 Martha Mundy, “On reading two epistles of Muhammad Amin Ibn ‘Abidin of Damascus,” in Forms and institutions of justice: Legal actions in Ottoman contexts, eds. Yavuz Aykan and Işık Tamdoğan (Istanbul: Institut français détudes anatoliennes, 2018), https://books.openedition.org/ifeagd/2332?lang=en. I thank Guy Burak for pointing me to this important article.