Following the Reconquest of the Tagus Line in 1149, a part of its defence effort was the responsibility of the Templars. Consequently they went up the Tagus and, when they got to what is Beira Baixa today, they turned northeast, following the Ponsul River, where various castles were built, forming a barrier to Muslim incursions. Monsanto, freed in 1165, was one of the first places fortified – built over a previous Muslim castle – within the scope of this operation, although it returned to the Crown in 1172. This Romanesque phase, barely recognisable today, was followed by a large Gothic reformation campaign between the late 13th and early 14th centuries, which completely encastled the top of the mountain. It was spared from works during the War of Restoration but was heavily remodelled in the 19th century. Its current form is the result of a vast, and at times debatable, restoration project in the 1940s and 50s.