The fortified castle-palace (alcazar) in Segovia comes from the 11th century but it was reconstructed several times. Like many fortresses in Spain it was originally built as an Arab stronghold. Throughout its history the building was used as the royal palace, a prison and a military academy. Segovia is located in the central part of Spain, in the Castile and Leon region, at the foot of the Sierra de Guadarrama Mountains.