In 1065 Ferdinand the Great, the Castilian monarch died and his kingdom was divided between his sons, with the eldest, Sancho, taking Castile.
Ferdinand had helped reconquer them from the Caliphate, but then had ceded them to his elder brother García Sánchez III of Navarre, the father of Sancho IV.
The war was also fought over Castile's ability to take part in the Reconquista, a capacity which had been diminished by the division of Ferdinand's kingdom in 1065.
According to the twelfth-century Crónica Najerense, a battle was fought during which campaign his alférez, Rodrigo Díaz de Vivar, defeated his Navarrese counterpart, Jimeno Garcés, and gained the nickname campi doctor or "master of the field [of battle]", later to become famous in Spanish literature as el Campeador.
[2] The chronicler of San Juan de la Peña, a Navarrese source, wrote that Sancho of Castile was forced to raise the siege of Viana and flee on a horse bedecked only in its halter; that he subsequently convinced Abd ar-Rahman of Huesca to go to war with Aragon; and that Sancho Ramírez eventually made peace with him anyway.