As the second son of the king of León and Count of Castile, Alfonso would not have been entitled to inherit the throne.
At the end of 1063, probably on 22 December, taking advantage of the fact that numerous magnates had gathered in León, capital of the kingdom, for the consecration of the Basílica of San Isidoro, Ferdinand I summoned a Curia Regia to make known his testamentary dispositions, under which he decided to distribute his patrimony among his children, a distribution that would not become effective until the death of the monarch in order to prevent any disputes arising after his death:
Alfonso inherited the Kingdom of León, "the most extensive, valuable and emblematic part: the one that contained the cities of Oviedo and León, cradles of the Asturian-Leonese monarchy", which included Asturias, León, Astorga, El Bierzo, Zamora with Tierra de Campos as well as the parias of the Taifa of Toledo.

His elder brother, Sancho, was given the Kingdom of Castile, created by his father for him, and the parias of the Taifa of Zaragoza.

His younger brother, García, received the entire region of Galicia, "elevated to the rank of kingdom" that extended south to the Mondego River in Portugal with the parias of the Taifa of Badajoz and Seville.

Their sisters, Urraca and Elvira, both received the Infantazgo, that is, "the patronage and income of all the monasteries belonging to the royal patrimony" on the condition that they remained unmarried.

The historian Alfonso Sánchez Candeira suggests that, although the reasons that led King Ferdinand I to divide the kingdom (with Alfonso VI inheriting the royal title) are unknown, probably the distribution was made because the king considered it proper that each son should inherit the region where he had been educated and spent his early years.
As the second son of the king of León and Count of Castile, Alfonso would not have been entitled to inherit the throne. At the end of 1063, probably on 22 December, taking advantage of the fact that numerous magnates had gathered in León, capital of the kingdom, for the consecration of the Basílica of San Isidoro, Ferdinand I summoned a Curia Regia to make known his testamentary dispositions, under which he decided to distribute his patrimony among his children, a distribution that would not become effective until the death of the monarch in order to prevent any disputes arising after his death:
Alfonso inherited the Kingdom of León, "the most extensive, valuable and emblematic part: the one that contained the cities of Oviedo and León, cradles of the Asturian-Leonese monarchy", which included Asturias, León, Astorga, El Bierzo, Zamora with Tierra de Campos as well as the parias of the Taifa of Toledo.
His elder brother, Sancho, was given the Kingdom of Castile, created by his father for him, and the parias of the Taifa of Zaragoza.
His younger brother, García, received the entire region of Galicia, "elevated to the rank of kingdom" that extended south to the Mondego River in Portugal with the parias of the Taifa of Badajoz and Seville.
Their sisters, Urraca and Elvira, both received the Infantazgo, that is, "the patronage and income of all the monasteries belonging to the royal patrimony" on the condition that they remained unmarried.
The historian Alfonso Sánchez Candeira suggests that, although the reasons that led King Ferdinand I to divide the kingdom (with Alfonso VI inheriting the royal title) are unknown, probably the distribution was made because the king considered it proper that each son should inherit the region where he had been educated and spent his early years.
Alfonso VI of León and Castile