The first Hafsid ruler commissioned this mosque for Friday prayers in the citadel. By 1233 its minaret was already standing above the fortress.