Castro Marim Castle has a rectangular shape with 4 round corner towers and 2 entrances. It is probably, in origin, a castle built by the Moors to protect the Portuguese coast. But the village was already an important port during Phoenician and Roman times. The Romans called it Baesuris.
In 1242 the castle was taken from the Moors by Don Paio Peres Correia during the reign of King Alfonso III. After the Christians had conquered Castro Marim they rebuilt and reinforced the castle. New battlements were built around the hilltop on which the castle stood. This was done to protect this strategic position against attacks coming out of the east; from Castile, and from Moorish attacks coming from North Africa. This created a castle within a castle situation. The inner castle became known as 'Cacela Velha' or the 'Old Castle'.
In 1319 King Dinis ordered another reinforcement of the castle's fortifications. He also made Castro Marim Castle the head quarters of the Order of Christ, created to substitute the Templar Order. Later King Fernando also restored the entire fortification. In 1504 another restoration followed, this time ordered by King Manuel.
In 1641 King João IV ordered the construction of Fort São Sebastião on the opposite hilltop to the south. Castro Marim Castle was again reconstructed and the two bulwarks were connected with walls that also enclosed the village between them.
Nowadays both bulwarks lie in ruins and the connecting walls have largely disappeared. This is a nice example of border fortification architecture over the centuries. The castle can be visited for a small entrance fee. The fort is freely accessible.