Located next to the sea, it is believed that the first fortification sited on the bar of the River Lima estuary dates from the reign of King Afonso III (13th century). However, the earliest certain date is the 15th century, when a fortress was built there that would have been completed in the following century, in the reign of King Manuel I. This is indicated by various Manueline architectural features, notably the 'Roqueta Tower' in the south-west bastion of the present fortress.
In the late 16th century, the fortress underwent a series of improvement works, having already been under Spanish domination in the reign of Philip II (Philip I of Portugal). And so the current fortress, with its polygonal floor plan, was built based on a design by Filippo de Terzi, the most famous architect of military buildings of that period.
References:The first written record of church in Danmark locality date back to the year 1291. Close to the church are several stones with a Christian text and cross inscribed. The oldest parts of the present red-brick church are from the 1300s. In the late 1400s the church was enlarged to the appearance it has today. The church has been modified both internally and externally several times, among other things after the fires in 1699 and 1889. There are lot of well-preserved mural paintings in the walls.