Sidi Mahrez

Sidi Mahrez ben Khalaf or Abu Mohamed Mahrez ben Khalaf ben Zayn (سيدي محرز بن خلف; 951–1022) was a Tunisian Wali, scholar of the Maliki school of jurisprudence and a Qadi. He is considered to be the patron-saint of the city of Tunis.

Life
He was born in Ariana to a father of Arab origin who traced his lineage to Abu Bakr. He studied in Kairouan and then in Fatimid-Egypt and became a teacher of Maliki jurisprudence upon his return. At the age of 57, he left his home-town (Ariana) and went into seclusion in Carthage. In c. 1014 he settled in Tunis, in a house in Bab Souika, which would become his mausoleum and later the Sidi Mahrez Mosque.

He proposed to his teacher Ibn Abi Zayd al-Qayrawani (922 – 996 CE) to write a aqidah and fiqh education book, and his proposal was concretised under the title Risala fiqhiya.