 It served as a mausoleum before becoming a madrasa by the order of Muhammad I, one of the Hafsid rulers.The madrasa is located in the northern suburb of the medina, near Bab el Khadra, one of its gates.Salem Bouhageb, a friend of the Grand Vizier Hayreddin Pasha, was one of the most important teachers of this madrasa and was later replaced by Sheikh Mohamed Taieb Ennaifer.