 The Leonese and Castilian armies suffered defeats in battles at Sagrajas (1086) and Uclés (1108), in the latter of which his only son and heir, Sancho Alfónsez, died, and Valencia was abandoned but Toledo remained part of an expanded realm that he passed to his daughter.The son of Ferdinand I, King of León and Count of Castile and his wife, Queen Sancha, Alfonso was a "Leonese "infante" [prince] with Navarrese and Castilian blood".His paternal grandparents were Sancho Garcés III, king of Pamplona and his wife Muniadona of Castile, and his maternal grandparents were Alfonso V of León (after whom he was probably named) and his first wife Elvira Menéndez.