11. The castle was the last stronghold of the Portuguese town. Its lifting gates and the overhangs atop the walls sought to prevent entry to this enclosure, following the technical tradition brought from Portugal, already influenced by Islamic military architecture.