Ferdinand was barely in his teens when
García Sánchez, Count of Castile, was assassinated by a party of exiled Castilian noblemen as he was entering the church of John the Baptist in
León, where he had gone to marry
Sancha, sister of
Bermudo III, King of León. In his role as feudal overlord, Sancho III of Navarre nominated his younger son Ferdinand, born to the deceased count's sister Muniadona, as count of Castile. Although Sancho was recognised as the ruler of Castile until his death, Ferdinand was granted the title "count" (
comes) and was prepared to succeed in Castile. On 7 July 1029, before a council in
Burgos, the capital of Castile, Óneca, aunt of the late García and queen Muniadona, formally adopted Sancho and Muniadona, making them her heirs. The record of the council is the first recorded instance of Ferdinand bearing the title of count. A later charter from the monastery of
San Pedro de Cardeña, dated 1 January 1030, explicitly lists Sancho as king in León (the overlord of Castile) and Ferdinand as count in Castile. The first indication that Ferdinand was independently reigning over Castile, or was at least recognised as count in his own right, is a charter of 1 November 1032 from the monastery of
San Pedro de Arlanza, which does not mention his father, but dates it to the time of "Fernando Sánchez bearing the county". Sancho's decision to name his son as count in Castile preserved its high degree of autonomy, although no Castilian document after 1028 is dated by the reign of Bermudo III nor is he ever named as king of León. The only sovereign whose regnal year was used was Sancho III, making Ferdinand the first count of Castile not to recognise the suzerainty of the king of León. Sancho III arranged for Ferdinand to marry García of Castile's intended bride, Sancha of León, in 1032. Two private Castilian documents dated 1 January 1037 both express Ferdinand's continuing vassalage to the Leonese monarch explicitly, dating themselves by the reign of "king Bermudo and Ferdinand, count in his realms". In a dispute over the territory between the Cea and Pisuerga, Ferdinand, nominally a vassal of Bermudo III, defeated and killed his suzerain at the
Battle of Tamarón on 4 September 1037. Ferdinand took possession of León by right of his wife, and on 22 June 1038 had himself crowned and anointed king in León. ==King of León (1037–65)==