Castile, which eventually formed a fundamental part of the kingdom of Spain, originated as a county of the kingdom of Leon, called Burgos.
Under Count Fernan Conzalez, in the 930s CE, the title of Kingdom was adopted, as the Count took his lands into independence, and the name Castile was selected, because the area contained numerous castles. The city of Burgos became the first capital (although later Valladolid succeeded to this honour), and Castile became a leading force in the reconquest of the central and southerrn areas of the Spanish peninsula from the Muslim Moors.
During this period the kings of Leon continued to treat Castile as one of their counties; in turn the stronger kings of Castile pressed their independence, and courteously threatened to take Leon itself into their dominions.
In 1095CE Castilian forces captured Toledo and in doing so took the southern lands beyond the Carpetan mountains which were to become known as New Castile, a warmer, and drier, land than Old Castile, north of the mountains.
In 1230 Castile re-united with the kingdom of Leon and the united kingdoms continued to drive the Moorish forces back.
Finally, in 1469, when Ferdinand of Aragon married Isabella of Castile, the way was opened for a single kingdom of Spain, which became a reality in 1516 when their grandson, Charles V assumed both thrones.