On the steep forested slopes north of the city is the castle, which has been in use on and off for almost 2,000 years.
The Romans were the first to occupy this site, constructing two cisterns, while the Moors erected the first walls.
When the Christians took over in 1148 they pulled these down, but had to build new ones straight away for Moorish attacks, including a mighty siege in 1184. Much later it was brought up to 19th-century standards, as stronghold 27 in the Lines of Torres Vedras, with 11 cannon positions.
Each era left its signature on the castle, like the Portão de Armas from the start of the 16th century, which still sports Manuel I’s coast of arms, flanked by two armillary spheres.