In the 19th century, Estácio da Veiga identified several archaeological finds in the "old town", constituting the first archaeological survey of Mafra. In his work "Antiguidades de Mafra" (Antiquities of Mafra) (1879), he mentions the presence of a rammed earth wall at the west end of the Palácio dos Marqueses Ponte Lima, isolated finds (such as a polished stone axe) and the existence of several silos in Rua das Tecedeiras (referred to by this archaeologist as tulhas).
In 1997, the first systematic archaeological interventions began in Mafra, excavating the medieval and modern necropolis of the Church of Santo André.
Twenty years on, in 2017, the construction of the new Health Centre brought the possibility of excavating the so-called "Quinta da Cerca" (the area belonging to the Palace of the Marquises of Ponte de Lima) and changing the knowledge about the origins of this town forever.
Research in recent years has made it possible to increase Mafra's longevity.
A town that was known to be medieval has now (demonstrably) been traced back to the Bronze Age, with the discovery of a 3,000-year-old house (2017).
The identification of single traces of Neolithic and Chalcolithic materials seems to indicate the presence of prehistoric communities, but there is not (yet) enough data to corroborate this.
Settlement before the Roman occupation (second Iron Age) was identified in 2020 when an oven was discovered on the slope northwest of the Palácio dos Marqueses, possibly related to a population centre that has not been found so far.
The wall structures from Late Antiquity (5th-7th centuries) have been discovered in the area next to the oven.
The medieval period was also enriched by these latest works, with the identification (and excavation) of a vast number of silos, which testified to the Islamic presence on this land and which Estácio da Veiga had already referred to the tulhas. Some were found exactly where he refers to them - Rua das Tecedeiras - and others were identified in an area with no previous interventions, probably outside the old town.
However, the existence of Mafra Castle, so often mentioned in historical sources, has yet to be confirmed (archaeologically).