Moulay Ismail charged the new governor of Tangier, Ali ibn Abdallah Errifi, with building the mosque; however, it's possible that it was his son, Ahmed Errifi, who actually carried out the construction.