It is believed that the castle was constructed on the site of a primitive Lusitanian castro that was later conquered by the Romans during the 1st century B.C.E. It was later remodeled by successive invading forces, including the Alans, Visigoths and the Arabs, although it is unclear when the present castle was established. In excavations carried out in the interior and exterior enclosures, various vestiges of Roman occupation were discovered including coins, millennium markers, and Roman foundations, while medieval remnants such as medallions and two marble columns were also discovered in the castle's vicinity.
The castle of Almourol is one of the more emblematic medieval military monuments of the Reconquista, and one of the best representations of the influence of the Knights Templar in Portugal. When it was conquered in 1129 by forces loyal to the Portuguese nobility, it was known as Almorolan, and placed in the trust of Gualdim Pais, the master of the Knights Templar in Portugal, who subsequently rebuilt the structure. The structure was reconstructed, starting in 1171 (from an inscription over the principal gate) and restored during the subsequent reigns.
Losing its strategic place, the castle was abandoned and fell into ruin. In the 19th century, it was "reinvented" by idealistic romanticists, which eventually led to interventions in the 1940s and 1950s and adaptation of the castle to an "Official Residence" of the Portuguese Republic. During this period, there were many restorations that transformed the physical appearance of the structure, including the addition of crenellations and bartizans.
The Direcção-Geral dos Edifícios e Monumentos Nacionais ("Directorate-General of Buildings and National Monuments"), a forerunner of the current Direção-Geral do Património Cultural, first intervened on the site in 1939, constructing the chemin de ronde in masonry and reinforced concrete, dismantling and reconstructing a corner of the keep, repairing and consolidating the battlements (including demolition of the alure of the tower), reconstructing a brick vault under the existing, and reconstructing the interior pavement in small stone.