The fortress of Carthage was used by the Muslims until Hafsid era and was captured by the Crusaders during the Eighth Crusade. The inhabitants of Carthage were slaughtered by the Crusaders after they took it, and it was used as a base of operations against the Hafsids. After repelling them, Muhammad I al-Mustansir decided to destroy Cathage's defenses completely to prevent a repeat.