This square fortress, constructed of rammed earth and masonry, dates back to the 9th century, but it was heavily modified in the 1400s to become the city governor’s residence. Adapted for firearms in the 16th century, it was in military use right up to the 1800s. Stroll the ramparts for sweeping views over the tangled lanes of the medina or watch the waves roll in from the small (and overpriced) cafe.