Along with the city walls and gates, several forts were constructed along the defensive perimeters of the medina during the different time periods. The military watchtowers built in its early days during the Idrisid era were relatively small. However, the city rapidly developed as the military garrison center of the region during the Almoravid era, in which the military operations were commanded and carried out to other North African regions and Southern Europe to the north, and Senegal river to the south.