The city of Tripoli was under the dominion of the Hafsid Dynasty during the late medieval and early modern period.