The mosque was built in AH 705 (1305/1306) in the Mamluk style by Abd al-Wahid al-Miknasi according to the founding inscription. The inscription was relocated from a fountain in the courtyard to a wall of the prayer hall during renovations in the 20th century. The inscription reads:[1]: 28–29, 30, fig. 15
أنشأ هذا المكان المبارك العبد الفقير إلى الله تعالى عبد الواحد المكناسي غفر الله له ولوالديه ولمن كان السبب فيه للمسلمين في تاريخ سنة خمس وسبعمائة "This blessed place way build by God's humble servant Abd al-Wahid al-Miknasi, may God forgive him, as well as his parents and anyone who has been the cause of it [its construction] for the Muslims, in the year seven hundred and five."
Stories tell that the Muslim Abd al-Wahid al-Miknasi from Meknes was visiting Tripoli after its Muslim conquest from the Crusaders. He stayed at the khan of a Christian who didn't treat him well. The wealthy Abd al-Wahid offered to buy the khan and after its acquisition transformed it into a mosque.[1]: 28
The stories of a transformation of a khan into a mosque can be supported by material evidence: That the mihrab is located at an angle to the qibla suggests that an older wall was reused.[2]
The mosque has two domes, one over the mihrab and one over a tomb chamber, the latter being ribbed.[1]: 29–31, 33 It has a small and simple minaret with an octagonal shaft. On its top eight windows open to each of its eight sides of which three have been closed. It is covered by a small dome.[1]: 31