The mosque was completed in 701 AH (1301/1302 CE), during the Marinid era; and comprises part of the Mansourah Castle. Excavations revealed that the mosque built by the Sultan Abu Yaqub, and that the decoration of the main gate was completed under the patronage of Abu al-Hassan in 735 AH (1334/1335 CE).
wiki/Mansourah_Mosque
Oh man, that’s a much cooler angle