Founded in 796 by the
Abbasid leader and the governor of
Ifriqiya,
Harthama ibn A'yan, several improvements and changes were introduced to the building throughout the medieval times, including the expansion carried out by Abu al-Qasim ibn Tammam in 966. Initially it was quadrilateral shaped and then renovated into a composition of four buildings with two inner courtyards. There's also a spiral staircase of about a hundred steps leading to the watchtower where visual messages were exchanged at night with the towers of neighboring ribats. Many watchtowers were added between 11th and 13th, 17th and 19th centuries in order to accommodate the artillery. The towers can be climbed by visitors, allowing spectacular views of the city and the beach. In addition to the small rooms dedicated to the worshiping
Mujahideen who were performing prayer and meditation during their military duty, the ribat has two
mosques, the larger of which today houses a unique collection of ritual objects and traditional medieval industrial materials. ==In popular culture==