The castle anchors the top of the hill and the northern end of the walled town. Its keep and walls date mainly from the late 13th century — built on Moorish and earlier Roman foundations — and the structure was given a Manueline overlay in the 16th century, especially the windows and arches of the inner courtyard.
The castle has been converted into a pousada (one of the original network of historic hotels), but you can walk into the courtyard for a coffee at the bar without being a guest. Don't miss the walk along the walls — they run unbroken around the town for about 1.5 km, with no railing on the inside drop, which is part of the thrill and part of the danger.