Founded in 893, the fortress of Hammamet had served as a home for the ribat caretaker and his principal companions, who retreated permanently here for reasons of devotion and asceticism, or to keep watch over the coast to ward off dangers coming from the sea. During the reign of the Hafsid prince Uthman (around 1463) it was considerably enlarged to serve as a residence for the city's governor. Hammamet - the Mahomette of medieval European navigators - gradually developed around this structure. However, unlike the city wall, this monument, occupying the north-western corner of the town, underwent major works to adapt it to firearms in the late 16thand early 17thcenturies.
No such works were undertaken in the 19thcentury, but European travelers who visited the town stated that it was well maintained thanksto the revenue of the habus/ waqf property(an inalienable charitable endow under Islamic law);that it was in good condition, armed with some twenty large-caliber cannons and occupied by a garrison. The monument, transformed into a barracks after 1881, deteriorated enormously in 1893; the terraces and a section of the eastern curtain wall collapsed. They were not restored until 1900.
As it stands today, the monument forms a distorted square with 50-metre sides, flanked at the corners by four projections of unequal shape and size. With the exception of the Hafsid oblong tower, which is higher than the curtain wall and consists of two defense chambers, all the bastions and curtain walls date from the 16thand 17thcenturies. A single doorway, topped by a machicolation (a projecting window), leads into a double-angled corridor where a commemorative inscription dating from 1600 may be seen. The curtain walls (12 m high and 6 m thick) are mostly built of rammed earth reinforced by a rubble stone facing wall. The courtyard is lined with cells that were previously used as prison cells and store rooms, which have been extensively altered. In the middle of the courtyard stands the mausoleum of Sidi Buali, a holy war volunteer of late15thcentury. Not far from there was the tomb of the Dey Ali Laz, who was executed in 1673 following the rebellion he led against the ruling Bey Murad II.