The Shamma'iya Madrasa was the first madrasa to be built in the whole
Maghreb region. It was constructed between 1236 and 1249 on the orders of the first
Hafsid sultan
Abu Zakariya Yahya. Ali ibn Mohamed ibn al-Kacem was the one in charge of construction works. The madrasa had a very important role in the society. Most of its students later became
imams of
Al-Zaytuna Mosque. The madrasa was renovated in later periods. It was restored by Shaykh Abu al-Rayth al-Kashash in the 17th century, and its current form is the result of a restoration ordered by Ahmed Khuja, who was
Dey of Tunis between 1640 and 1647. == Architecture==