In 1160 the Almohad Sultan Abd al-Mu'min ordered that a permanent settlement, including a castle, be built. It received the name of Medinat al-Fath (City of the Victory). The Tower of Homage of the Moorish Castle remains standing today.