The Kingdom of Castile was one of the medieval kingdoms of the Iberian Peninsula. It began in the 9th century: it was called County of Castile and was a vassalagedepending from the Kingdom of León. It was one of the kingdoms that existed before the Kingdom of Spain.
11th and 12th centuries: Expansion and union to the Kingdom of León
In 1028 Sancho III the Great, of Navarre, married the sister of count García Sánchez and inherited title to the County of Castile after his brother-in-law's death. In 1035 he left the county to his son Fernando. Fernando I was married to Sancha, sister of Bermudo III of León. Fernando I began a war with León and in the battle of Tamarón against a coalition of Castile and Navarre the king of León was killed, leaving no offspring. His brother-in-law Fernando took the crown of León for himself and their three sons took the kingdoms of León (Alfonso VI), Galicia (García) and Castile, Sancho, becoming king and borning the Kingdom of Castile.
Notes
↑The first reference to the name "Castilla" can be found in a document of the year 800: We have erected a church to the honour of Saint Martin, in Area Patriniano, in the territory of Castile. In the chronicle of Alfonso III (King of Asturias, 9th century) it is written: The Vardulias are now called Castilla.