Built in 1641 during the Portuguese Restoration War against Spain, the Forte de São Sebastião sits on the second of the two hills that flank the old town. It is a textbook small bastion fort — four pointed bastions, a dry ditch, a single gate facing the medieval castle opposite — and it was placed deliberately to cover the approach from the river crossing.
The fort never saw a serious siege. It was used as a prison and then a customs post, and today it is freely accessible whenever the gate is open. Inside there is little more than the bare parapets, but the elevated position gives the best photograph in town: the old castle on its hill across the rooftops, the white houses spread between, and the salt flats stretching east to the river.