In 913 an independent Kingdom of León was founded with its capital at the city of León. Almost immediately the kingdom began to expand to the south and east, populating its newly gained territory with numerous castles. The area was the County of Burgos until the 930s, at which time Count Fernan Gonzalez began a campaign to expand Burgos and make it independent and hereditary. He took the title King of Castile, after the numerous castles in the area, and continued expanding his kingdom at the expense of León by allying with the Caliphate until 966 when he was stopped by Sancho the Fat of Leon.
León was conquered in 1037 by King Ferdinand I (the Great) of Castile, who took the title King of León. The two kingdoms later split around 1195, when a major defeat of Alfonso VIII weakened the authority of Castile, but were reunited in 1230 under Ferdinand III. Later kings of Castile continued to take the title King of León and to use a lion as part of their standard. Under a unified Spanish kingdom León became a captaincy-general. The modern province of León was founded in 1833.