 A Muslim era fort, which was itself largely replaced by the present structure, was built by the Berber Almoravid dynasty.The first reference to this castle was in 1120, around 32 years after the city of Segovia returned to Christian hands (during the time when King Alfonso VI reconquered lands to the south of the Duero river down to Toledo and beyond).The shape and form of the Alcázar was not known until the reign of King Alfonso VIII (1155–1214), however early documentation mentioned a wooden stockade fence.