Starting from small beginnings, São Julião has been modified, expanded and adapted over several centuries. The construction of a fort on the right bank of the Tagus River was recommended by the King of Portugal, Manuel I, to his son and successor, John III. In 1549 John III created the position of Master of the Works of Fortification of the Kingdom, and initially entrusted the architect, Miguel de Arruda, with construction of several fortified complexes in overseas Portuguese territories. Following a decision that the defence of Lisbon would be best served by a defensive arrangement incorporating several forts, work on the Fort of São Julião da Barra, under the supervision of Arruda, began in 1553 and had been completed by 1568.
The defensive arrangements also incorporated the Tower, later Fort of São Lourenço do Bugio, situated on a sandbank in the middle of the Tagus estuary, and the role of these two forts to protect the entrance to the Lisbon bar were complemented by the Citadel of Cascais, as a first defence at the mouth of the river, and by the Tower of Belém close to Lisbon and the Fort of São Sebastião de Caparica on the left bank, which were seen as a last line of defence. Additional work continued in 1573, when those awaiting deportation and held in the fort's dungeons were used for forced labour. In 1579 a Spanish spy in the service of Philip II of Spain produced a drawing of the fort, which was subsequently attacked from the land by Spanish troops under the command of the Duke of Alba. The garrison surrendered on 13 August 1580.
During the Spanish occupation the Duke of Alba planned the reinforcement of the fort, raising new batteries and extending the defenses of the western flank. In 1582 bastions were added to the eastern side. Further enlargement and reinforcement was carried out from 1597. Together, these works transformed São Julião da Barra into the largest and most powerful fort in Portugal.