It was founded in 910 A.D. . The Atlantic provinces became the Kingdom of Portugal in 1139 , and the eastern , inland part of the kingdom was joined to the Kingdom of Castile by 1230 . It was founded in 910 AD when the Christian princes of Asturias along the northern coast of the peninsula shifted their main seat from Oviedo to the city of LeÃ n. The County of Portugal separated to become the independent Kingdom of Portugal in 1139 and the eastern , inland part of LeÃ n was joined to the Kingdom of Castile in 1230 .