After the destruction of the port city of Tripoli in 1289 by the army of Qala’un, the Sultan decided to build a new city inland at the foot of “Pilgrim’s Mountain” where a Crusader bourg had developed over the years, around the castle of Saint-GilIes. Qala’un gave orders that amosque be erected on the emplacement there of the gutted Crusader church, once Saint Mary’s of the Tower.
The Mansouri Mosque was named after the Mamluk sultan who conquered Tripoli from the Crusaders in 1289, al Mansour Qalawun. The mosque itself was erected by his two sons, al Ashraf Khalil, who ordered its construction in 1294, and al Nasir Muhammad, who had the arcade built around the courtyard in 1314.
Two elements, the door and the minaret, probably do belong to an earlier, Christian structure that were incorporated into the mosque when it was built, but the building—comprising its court, arcades, fountain, and prayer hall—is essentially a Muslim creation.
In the vicinity of the Grand Mosque of Tripoli, or actually attached to it, are six Mamluk ,madrasahs, Islamic schools founded for the explanation and interpretation of the Roran and the presentation of the hadtth or sayings of the Prophet. Adjacent to the madrasahs are the tombs of their benefactors. The most elaborate is the al-Qartawiya, built by Emir Qaratay, Mamluk governor of Tripoli from 1316 to 1326 and again from 1332 to 1333.