The original mosque on the site was Almoravid, constructed by Yusuf ibn Tashfin (r. 1061-1106/453-499 AH), but substantially rebuilt in 1136/530 AH by his son 'Ali Ibn Yusuf (r. 1106-1143/500-537 AH). The minaret and dome were added ca. 1236 by Yaghmorasan Ibn Zyan (r. ca.1235-1283/632-683 AH).
Mosque: 60 x 50 m ; Prayer Hall: 49,30 x 25 m ; Minaret: H. 29,15 m