The main objective was to keep the capital free from French troops - not only for the strategic value of its port, but also for security reasons because, in the event of military failure, the English troop corps would be shipped, in São Julião da Barra.
On October 20, 1809, Wellington drew up the famous memorandum with instructions that were to be followed by the engineering commander of the English army - Lieutenant Colonel Fletcher - in the construction of the defense works. Thus, a military system was designed based on four lines of defense, two main and two complementary. Construction work began in the fall of 1809 and, in less than a year, 126 fortifications, military roads and other natural barriers.
The City of Torres Vedras is located at the most advanced point of the 1st Line, located about 13 kilometers north of the 2nd Line. The 1st Line was 46 kilometers long, connecting Alhandra to the mouth of the Sizandro River. In order to reinforce the elevated positions, devices were prepared to flood the lands next to the Tagus and in the Sizandro valley, in order to hinder their crossing, as well as progression by road.
The improvement of the Lisbon Defense Lines continued until 1812, since Napoleon's new attack was expected, which did not happen. 152 military works were built, including redoubts and batteries, 37 of which in Torres Vedras, equipped with 523 fire hydrants. The São Vicente Fort, together with the Olheiros stronghold, which defends the west flank, constitutes one of the main defensive points of the Lines of Torres Vedras.