At the beginning of the Portuguese Restoration War (1640-1668), the fort suffered its second siege, by troops loyal to the Duke of Braganza, who became King John IV of Portugal in 1640. Under his reign further repair works were carried out to the fort including construction of barracks and lodgings for the garrison and further defences against attack from the land. Further improvements were implemented in 1751 but in 1755 the fort suffered damage as a result of the Lisbon Earthquake, the most serious being the collapse of the lighthouse tower in the centre of the square. The lighthouse resumed operation in 1761.