Kingdom of Castile was one of the medieval kingdoms of the Iberian Peninsula. It emerged as a political autonomous entity in the 9th century. It was called County of Castile and was held in vassalage from the Kingdom of León. Its name comes from the host of castles constructed in the region. It was one of the kingdoms that founded the Crown of Castile, and the Kingdom of Spain