The Fort of São Miguel Arcanjo is built on cliffs, surrounded by the sea to the north, west and south. A primitive fort was initially constructed in 1577 under the orders of King Sebastian I of Portugal, with the intention of defending the fishing, shipbuilding and wood trading activities of Nazaré from attacks by Algerian, Moroccan, Dutch and Norman pirates. By 1595 it was equipped with four pieces of artillery. Further work was carried out between 1639 and 1641, when the number of artillery pieces was increased to six. The fort was again upgraded in 1644, under the instructions of King John IV, at which time it acquired its current shape and was given its name. It has an irregular plan, which was necessary to adapt it to the outline of the promontory on which it is built. On the portal above the entrance, King John ordered a limestone image of St. Michael the Archangel to be placed, with the caption "EL REY DOM JUAN-1644".
During the French invasion of Portugal it was occupied in 1807 or 1808 by a detachment of 50 men, after its artillery pieces had been removed to the Citadel of Cascais to provide protection for Lisbon. The French were imprisoned by the local inhabitants after a group of students succeeded in persuading the invaders to surrender, convincing them that the Portuguese had received reinforcements. At the same time people from Nazaré travelled south by boat to Cascais in search of armaments, which enabled them to repel the French reinforcements that were heading from Peniche to the north, to aid the French garrison. The fort became a landmark of popular revolt but, later, the French invaders returned to the area, killing inhabitants and burning houses and boats in reprisal.
In 1831 the fort housed a military detachment, supported by two 12-gauge pieces, but these were transferred to Peniche in 1833. The fort was the site of skirmishes in the Liberal Wars, or Portuguese Civil War, involving fights between supporters of the two royal brothers, King Pedro IV and King Miguel I. After the departure of D. Miguel I to exile, in July 1834, the stone image of St.