Sidi Mahrez ben Khalaf or Abu Mohamed Mahrez ben Khalaf ben Zayn (Arabic: سيدي محرز بن خلف; 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.[1] 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.[2]