The Alcázar of Segovia (literally, “Segovia Fortress”) is a castle, located in Segovia, Spain, a World Heritage Site. Rising out on a rocky crag above the confluence of two rivers near the Guadarrama mountains, it is one of the most distinctive castle-palaces in Spain by virtue of its shape – like the bow of a ship. The Alcázar was originally built as a fortress but has served as a royal palace, a state prison, a Royal Artillery College and a military academy since then. It is currently used as a museum and a military archives building.
More details could be read on the following Wikipedia page: