The castle was founded in 1160 and comprised the walled village, the terreiro and the military house located between the Mestre's house, the Alcáçova, and the knights' oratory, in a roundabout, the Charola, which was completed in 1190. In 1420, with the castle then seat of the Order of Christ, Infante D. Henrique, the Navigator, transforms the military house into a convent, for the branch of contemplative religious that he introduces into the Order of Christ, and adapts the Alcáçova to his manor house.
At the beginning of the 16th century, D. Manuel I, King and Governor of the Order of Christ extends the Templar Rotunda to the west, with a new construction outside the walls, which begins a decorative speech that celebrates the Portuguese maritime discoveries, the mystique of the Order of Christ and of the Crown in a grandiose manifestation of power and faith.
The church of Santa Maria dos Olivais has been the pantheon of the Order of the Temple since the 13th century and some Templar masters are buried there, including D. Gualdim Pais.