The gentlemen of the "Republic" of Cordoba, led by Abd al-Malik, led the resurgence of the city-state in the latter 11th century and prompted outside intervention into Iberian affairs by other Christian princes, such as William of Toulouse
Spain, at the time, was divided between two powerful states, above and below the Tagus. To the south, Cordoba, now a republican city-state, revived her power under the government of Abd al-Malik. From the begin of the decade, he began the policy of making peace with Christian princes and turning Cordoba's armies against the numerous neighboring
taifa (an independent Muslim-ruled principality, an emirate or petty kingdom, of which a number formed in the Al-Andalus (Moorish Iberia) after the final collapse of the Umayyad Caliphate of Córdoba in 1031) states. Only those bordering the Christian states of the north, such as Zaragoza and Albarracín, escaped the onslaught.
To the north, the Kingdom of Leon dominated the scene. Though successful against the Muslims in nearly a decade of constant war, Enrique I accepted the generous monetary peace offered by Cordoba in the early 70's. Leon now turned to preparing for war with their cousins in Navarra (who had recently annexed the Kingdom of Aragon) and eventually went on to lead the way in the First Crusade.
To William of Toulouse it was evident that the focus of both the Christian kings of Spain was wrong and could only lead to the ruin of their states. While their energy was wasted against fellow believers or abroad, the Muslim princes of the south were nearly ready with their consolidated power to drive for the Pyrenees. By the time of the First Crusade, it is clear that the Duke of Toulouse and his vassals were convinced that the only way to save Spain and their only lands from conquest was by a powerful French offensive into Spain, since the Spaniards refused to do that deed for themselves. Of course, beside such altruism, the prospect of new lands and titles to be gained in such wars (along with the remission of a lifetime of sins) boosted the support for the effort all the more in the Duchy.
The route of the Crusade army to Jaca - Autumn 1077
Duke William's trusted lieutenants - Marshal Michels of Carcassonne and Raymond of Toulouse, Count of Rouergue and William's younger brother
After conducting a rare census (which is covered in more detail in "Toulouse and the First Anglo-French War," The Four Hundred Years War, Vol. 11 and "A Provencal Host - The Arms and Tactics of Duke William of Toulouse," Early Medieval France, Vol 28) in the spring of 1077, Duke William marched south that autumn to the County of Jaca. Although there are no documents to prove the motive, it is most likely that the news of King Sancho of Navarra's hasty peace with the Emir of Zaragoza, Yusuf al-Mu'tamin, prompted the near wintertime movement. This, along with the new war with England launched by King Philip I in August, most certainly convinced William that there was no better time than the present to enter Spain.
Sancho, Count of Jaca and cousin of the King of Navarra
Arriving in the bitter cold of January, the hosts of Toulouse forced themselves upon Sancho, Count of Jaca, as guests. William apologized for situation, even paying the Count for the use of his supplies and various quarterings till spring. Sancho, for his part, dared not complain he knew that even if he had wanted to evict the Frenchmen, the entirety of Navarra did not have the army to do so. Instead he praised William as "savior of Hispania" and wished him well in his war with the Muslims. Few, in truth, expected the Duke to be anymore successful at fighting the Muslims than the Spanish themselves had been.
The men of Provence knew better, though, and had every confidence in victory when war finally came. So it was, when William broke the winter rest of his army late in January and crossed into the Emirate of Zaragoza, they were ready and more than eager to fight.